LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having difficulty controlling DIO96 with a .vi that I wrote

Vast improvement on readability. Now I can see what you are doing. You may still have a problem though. You are configuring the ports in parallel. What I mean is that each config vi is running at the same time. I don't know how the hardware will react to that. Same thing for port writing. They can all try to occur at the same time. What you should do is use the error in and error out to force the execution flow to run only one config at a time, and one write at a time. If you wire the error out from the first config to the error in of the second, then out from the second to in on the third, and so on. The out from the last config can go to the error in on the first write, and first write out to second write in, and so on. This way, the harware will only see one function at a time instead of multiple functions trying to compete for harware attention. Maybe this was your problem all along. Another very minor thing is that all inputs should come from the left and all outputs should go to the right. Like I said, it is very minor, but I would place the booleans and their logic on the left side, the boolean conversion to numbers in the middle, and the port writes on the right side. If you were to highlite execution (the light bulb), you would see that the execution flow is just as I described, booleans first, conversion second, then port writes last. I think the error in/out re-wiring will solve your problem.
- tbob

Inventor of the WORM Global
0 Kudos
Message 11 of 14
(666 Views)
tbob,

The re-design of the block diagram made the difference! 🙂

I haven't yet implemented your advice regarding the error in/out connections, I'm going to try that next, just to make things proper. But, it seems to be working properly without that.

One last question for you: Presently, I have the .vi file in the Windows Startup folder so that it launches when the PC boots. Question is this: though the .vi loads on boot, it doesn't automatically run. It still needs to be manually started. Is there a way to make .vi files execute automatically when loaded?

Thank you very VERY much for your help on this one. For me, there have been lots of "a-ha" moments as I learned where my mistakes have been.

Cheers!
-darren
0 Kudos
Message 12 of 14
(656 Views)
Darren,

Pop-up on the icon and select VI Properties...>>Execution>>Run when opened. That will make your VI run when it starts.

Lynn
0 Kudos
Message 13 of 14
(654 Views)
Anytime you create a vi to run when opened, keep another copy somewhere that does not run when opened in case you want to edit the vi later on. Another method is to compile the vi into an EXE using the Build Applications tools. Put the EXE into your startup and it will start automatically.
- tbob

Inventor of the WORM Global
0 Kudos
Message 14 of 14
(646 Views)