LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record to a file on numerical increment

I am trying to get an old Optronic Laboratories scanning monochrometer working with labview, its old, runs from a dos based PC with a ISA DIO card. I have replaced the card with a Advantech USB-4751 and I have basic controls working fine. Now I am trying to save the data. I have the two pieces of data, Radiometer Value and Spectrometer Wavelength (in nm) and I want to save the data at .1nm increments. So far I have tried picking off on the bit that correlates to .2nm increment (Feedback is BCD) and tied a indicator with a value(signaling) parameter on it to trigger an event loop that would append the to values to a file. But as soon as I hit Run on the VI the thing just starts dumping those values to the file over and over even though I have a for loop set to 1. And as far as I can tell the val(signal) is not changing state. 

 

I thought maybe I was having a signal noise issue but I disconnected the USB device from everything and it still does it, also checked the signal lines with a scope and it is dead smooth. 

 

Is there another way to create this data and save it?

0 Kudos
Message 1 of 3
(1,176 Views)

You are writing to a Value(signalling).  That means every time a value is written to that node, the Value change event is triggered and will run.  It doesn't matter if you are writing the same value to it over and over again.

 

You should only write to the Value (signalling) in an case structure where the new value is compared to the old value (kept in feedback node.) and is different.  That, or in your event case put the code to run in a case structure that only runs when the values from the left hand nodes OldVal <> NewVal.

 

With the first way, you only fire the event structure when the value has changed.

With the second, way, the event structure fires on every loop iteration, but the code inside the event case only runs if the values are different.

 

I'd lean to the first way.

 

 

 

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

Ahh, Ok. I am going to write that into a state machine which will handle incremental moves while I am at it.

 

Thanks!

 

-Jerry

0 Kudos
Message 3 of 3
(1,127 Views)