Log 4 the change in 4 seperate analog channels


Recommended Posts

I have 4 analog channels named In1 through In4. I want to log to a CSV file, the time, channel name and direction (up or down) whenever any of the channels goes above 1 volt or below 1 volt.

Is this possible to script?

I am using DAQFactory express (Rev 5.84 Build 1636) on a Labjack U3.

Thanks,

Darren

Link to comment
Share on other sites

Sure, create a Test D to A channel to store the up / down status (as 0 or 1), then in the Event for your input channels, use an if() to evaluate for the desired condition, and do myTestChannel = 1 or =0 and add myTestChannel (or whatever you name it) to your logging set. For example:

if ((In1[0] > 1) && (In1[1] < 1))
   myTestChannel = 1
endif
if ((In1[0] < 1) && (In1[1] > 1))
   myTestChannel = 0
endif

Note that this example doesn't have any hysteresis, but it will set myTestChannel to 1 when the signal transitions from below 1 to above 1, and 0 when it transitions the other way.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.