03-25-2008 06:33 AM
03-25-2008 07:01 AM
Jeff,
One more thing. Please have a look at the attached. I have put the Logic VI inside another VI which is performing my DAQ. I have simplified this VI so it is easy to explain my problem. When I run my main VI (trial 1) and press a button on the front panel, the subVI for the logic isn't doing anything. It just keeps repeating the close case. Ie. when I push open on trial 1 vi front panel, nothing happens. Any suggestions?
03-25-2008 07:18 AM - edited 03-25-2008 07:19 AM
The event case is for user events. So, if a button is pressed, LabVIEW notices the user interface event and triggers any associated event structures. If you pass values to a SubVI, the SubVI just runs with those values as a sort of "default" value. There is no change associated with the controls because the VI loads the values of the controls and then runs, so the data is constant for the operation of the SubVI, hence no Value Change Event.
I would move the event structure into Trial1.vi to catch what the user wants more easily. Also, you didn't include PST Write Output.vi so I'm not positive on this, but I think your reads and writes might be a little mixed up. You should only have to write a true or false to energize a solenoid, but you are passing arrays to your writing vi. You need to read your sensors, compare them to something, and use that true or false to control the solenoid. Also, I would put your sensor reads inside the case structures, that way you only check the limit sensor when you're doing a partial stroke, and you only check the full sensor when you're doing a full stroke. It's not critical, but not checking both sensors every time will speed up your program.
05-15-2008 10:49 AM
05-16-2008 04:29 AM