05-31-2007 12:18 PM
05-31-2007 01:28 PM
05-31-2007 04:19 PM
yes. Create a control or indicator for the switch value. Create a property node for that control or indicator and wire the value read from the daq to the "value(signaling)" property and not the "value" property. The difference between the two is the "value(signaling)" changes the value and generates a change value event where as the "value" property only changes the value.
cheers,
Drew
05-31-2007 06:21 PM
06-04-2007 08:47 PM
06-04-2007 08:49 PM
06-05-2007 08:08 AM
Strategic use of "NaN" with multiple plots will let you define unique colors for segments of a plot.
See here.

Ben
06-05-2007 11:22 AM
Hi perge,
I agree that the current code is much easier to follow and I think this type of architecture will allow greater flexibility down the road. I was not expecting you to use queues but rather enum constants passed from each state to a shift register on the while loop, but I think they are doing the same thing. There might be an added benefit to using queues but I have very limited experience with them.
Related to the event structure, read this http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/caveatsrecmndtnsevnts/ I think the second and third bullet will clear up confusion about the latched booleans and panel locking.
Hopefully Ben answered your question related to the plot color.
I have had the end of file error when consecutively reading a file twice. I was using more native file read functions and the problem was the read marker moved to the end of the file on the first read so the second read caused a end of file error. To get around this, after every read I reset the read marker back to the beginning of the file. It looks like you are using an express vi for the read and I don't know if this vi opens-reads-and closes the file which should not cause this problem. However, if you have a refnum for a file try using the set file position vi located in the advanced file functions on the file I/O palette. Set the start to zero and offset to zero to reset the file marker to the beginning. Also, you can use the get file position vi (located in the same palette) to see if this is indeed the problem.
For the analog read and plotting, you might want to consider combining the read and plot states so you can use the timed loop structure. The read loop can be stopped with a simple boolean wired directly to the loop exit terminal. After the AI, the data can the still be saved in the store data state. This should give better timing of your AI and puts the file I/O to a lower priority. If you do this, be careful about the state of the stop boolean after the read loop finishes, ie you might have to reinitialize it after the loop so when you plot again the loop doesn't quit after the 1st iteration.
Hope this helps. I also recommend writing small test vi's to test certain functionality of your code. For instance, you are unsure about closing the com port. You could write a small vi to test this apart from the main code. It appears you are doing serial communication so you may find that you need to flush all the buffers (on the advanced serial palette) before closing the VISA session.
Regards,
Drew
06-06-2007 04:08 PM