The idea is that you only pass the address of the current channel data structure: &(pid_array[num])
e.g. &(pid_array[0]) then &(pid_array[1]), etc This way each function will only access it's own data. If you need to access some other data then you need to pass &(pid_array), and handle the channel number in some other way. Regards, Alex ----- Original Message ----- From: "Xuecheng Xi" <[EMAIL PROTECTED]> To: "emc-developers" <emc-developers@lists.sourceforge.net> Sent: Sunday, April 01, 2007 10:59 AM Subject: [Emc-developers] get channel number from real time thread function > Dear Developers, > > I am writing a real time thread function in which I need to use the > channel number. Take pid.c as an example, the number of channel = > num_chan. For each channel, we have exported > > calc_pid(void* arg, long period). > > by using > > hal_export_funct(bu, calc_pid, &(pid_array[num]), 1, 0, comp_id). > > My question is in the function of calc_pid(void* arg, long period), > how can I know for which channel I am doing the calculations. As > from > the arguments (void* arg, long period), there is no information > regarding the number of channel. > > regards > Xuecheng > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.24/741 - Release Date: > 31.3.2007 20:54 > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers