LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC datasocket write problem

I have a main while loop (10sec timer)with heavy image analysis, and another while loop(0.1sec timer) that simply writes the resulting single number from the first loop into a OPC server via datasocket write function.

While it does work, the resulting datalog shows random 0's or huge numbers included once in a while.

(almost everytime the main loop is processing)

 

It seems like when the main loop is ongoing the second loop stutters and misfires.  

How can I keep my data stream clean of these errors?

 

Thanks

 

0 Kudos
Message 1 of 3
(2,136 Views)

Hi,

how have you solved two while loops?

 

Simyfren

0 Kudos
Message 2 of 3
(2,099 Views)

This may be the same question that simyfren was getting at, but how are you communicating between the two loops?

 

I'm also a little confused about why you're writing values to the server every 100 ms when your processing loop is running every second. My interpretation of your description is that each time the main (10 sec) loop executes, it's producing one data point, and then the secondary loop writes that value to the server. If that's the case, then why are you writing to the server every 100 ms? Do you want values to be repeated? Or is the main loop actually producing several different values, all of which you're writing to the server?

 

Does your main loop take the full 10 seconds to execute, or does it execute in less time and you just want to run it every 10 seconds?

 

Also, if you post a screen shot of your VI, it may give us and any other members of the community more insight into what you're doing so we can provide you with more specific tips.

 

Regards,

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments
0 Kudos
Message 3 of 3
(2,075 Views)