LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making code more efficient

If getting rid of the lag is a requirement, then a Producer/Consumer framework is necessary. Otherwise, good to hear you're making some progress!

0 Kudos
Message 11 of 13
(749 Views)

Hey so I have changed the program a bit and would like someone to take another look. I had it working well but... Something always goes wrong. Before I had my instruments in unprompted mode and they sent me data once every tenth of a second but they were not in sync and one sent data slightly faster and bytes began to pile up at the port and the timing for the fast instrument continued to be off since bytes are waiting in the port. I could separate each instrument and have them get their own timestamp into different save files but I would like them to have the same time stamp. So I changed both instruments to prompted mode so it would only send me data when I wrote a command, but I am not getting as much data as I should be. I was not sure if my program was still not good enough or maybe it takes to long to write to the instrument. Those were my ideas.

0 Kudos
Message 12 of 13
(723 Views)

We can't see your subvi.  This may be where the problem lies.  Even if one is responding faster than the other, it should not be a problem.  You will just get more data from one than the other.  Its how you handle the data that coutns.  If you think you are missing data, then check your code that sends the command and reads the data.  Or post your subvi here.

- tbob

Inventor of the WORM Global
0 Kudos
Message 13 of 13
(708 Views)