Stop data acquisition when data falls quickly/sharply from peak


Recommended Posts

 

Hi,

I am reading three channel: motion(Test), motionRaw(Labjack), pressure(LabJack). I want to acquire "pressure" when "motionRaw" falls between 0.2 and 1.2v.

I want to stop acquisition as soon as pressure value starts to drop rapidly. The following code I used for this purpose.

When x axis is 100 points, the difference of pressure[0] and pressure[1] is greater then 0.5. So, data acquisition should be stopped. But, in my case, it did not  stop. What did I do wrong?

 

read(pressure)

motion.AddValue(motionRaw[0])

 

if ((motionRaw[0] > 0.2) && (motionRaw[0] < 1.2)) && (pressure[0]- pressure[1] <0.5)&& (pressure[0]- pressure[1] >-0.5)

   beginexport(OneLine)

endif

Please help

Capture.PNG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.