Log One Entry?


Recondaddy

Recommended Posts

I am monitoring a pressure transducer on a hydraulic press with a LabJack U9 and DAQFactory Express. Currently, whenever the pressure at the transducer exceeds 20psi, I begin logging values. Due to the rate at which I'm scanning, I'm getting about 100 points per second. This is a good method for seeing the pressure profile of the punch from start to finish.

However, I'd also like to monitor the uptime of the machine. My thought was simply to log one value (a snapshot) per punch to a separate log file, so that I can see when the machine is punching and when it's not.

I can't seem to configure the software to log only one value, though.

Any ideas?

Link to comment
Share on other sites

  • 1 month later...

Thanks for the reply!!

What I've done is place some code in the Event tab of the channel I'm monitoring.

if (Pressure[0]>100)
	 beginexport(MyExportSet)
endif

Export Set Details:

Mode: Fixed Interval

Interval: 0, Snapshot

This approach is not working for me. It's still logging data points as fast as it can. My guess is that it's repeating this statement for as long as the current pressure is above 100psi. So, it's invoking the beginexport method at the current scan rate (100 per second) and logging 100 data points per second.

I've tried putting a 1 second delay in after calling the beginexport method, but it doesn't work.

Any other ideas?

Thanks.

Link to comment
Share on other sites

Never put delay() in an event. It will slow down whatever triggered the event (in this case, the data acquisition).

You should put this code in the channel that tells you the punch is occurring. If this is the pressure channel, and you want it to log once, whenever the pressure crosses the 100 point, just change your if():

if ((pressure[0] > 100) && (pressure[1] <= 100))
   beginExport(myExportSet)
endif

This will cause it to trigger only when the pressure first crosses 100. It won't trigger again until the pressure drops below 100. Note that noise on the line may cause multiple logs for a single punch.

Link to comment
Share on other sites

Archived

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