05-11-2016 11:29 AM - edited 05-11-2016 11:29 AM
Hi All,
Need some suggestions on how I should go about building my VI.
So this is what I'm trying to do.
I have 5 relays which I'm controlling with LabVIEW (just using a simple Digital output to turn them ON/OFF)
so DO0-DO4 to control 5 different relays.
The problem is, each relay has different profiles/cycles than need to be run simulatenously
For example:
Relay 1 turns ON for 1 min and OFF for 1 min for a total time of 180 mins
Relay 2 turns ON for 30 mins OFF for 30 mins for a total time of 180 mins
Relay 3 turns ON for 60 mins OFF for 30 mins for a total time of 180 mins
etc etc
The one consistent thing about the program I'm working on is that its a 180 min run.
During the 180 min , each relay will be turning on/off at different times which is where I'm having trouble.
How can I run this type of profile? While loop for each relay? but I couldn't get them to work simultenously.
If anyone has a suggestion to control multiple relays with varying ON/OFF time in sequence, I'd love to hear it.
Thank you!
05-11-2016 03:03 PM
I have done something similar using the dynamic calls to a reentrant VI. So the idea is to open a reference and run (not waiting for completion) the VI in a FOR loop. Then each call will be running off on its own.
05-03-2019 03:32 PM - edited 05-03-2019 03:34 PM
Hello, I need to implement the same concept. I basically need to control two relays at the same time but one will turn off sooner than the other. Is there an example of how to program this any where?
05-05-2019 09:39 AM
Give a good look for Queued Message Handlers and for State Machine. I am picturing a main loop that is a state machine and then it gives commands/messages to 2 other loops that are QMHs to handle the actual relay controls.