CuriousMind Posted August 13, 2020 Share Posted August 13, 2020 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 Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted August 13, 2020 Share Posted August 13, 2020 The line motion.addValue() needs to be right after the if(), not before it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.