LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing effeciency of my code

HI,

I am using labview6.0 with PCI 6014 module for single point input, single point output, waveform output and counters. In addition to my pci card I am acessing data through the serial port. As most of the data is independent of each other I am using sperate loop for each operation with sleep tine of 100ms and updating their respective global parameter inside their respective loop. I am using another loop with sleep time of 1 sec to save the global values(I need to monitor process values for every 1 sec) into a file. As my process parameters do not vary very rapidly I am satisfied with the asynchronous data if the scanning time difference between all parameters is less than 1 sec.

I have not faced any problem by using this me
thod. But I am not sure if it is a good practice to put different data acquistion process in different loops. Please indicate if I can use a better procedure.

Thanks,
0 Kudos
Message 1 of 3
(2,450 Views)
I would be on the track as you. Be aware of the race condition though.

-Joe
Message 2 of 3
(2,450 Views)
Since the data are independent I wouldn't expect that there are problems with the acquisition. I would suggest that you consider using a queue or a notifier to transfer the data from the data acquisition routines to the data storage routine rather than globals.
Message 3 of 3
(2,450 Views)