11-18-2012 10:12 PM
Hello
In my project ,I need to use PC event structure to send message so that relay in my system has different states .
Right now I have two boolean buttons in FP. For one of button "queue event" , when I press this button, I need to send 3 messages to msg queue so that state machine will automatically change their state every 5 mins following message order. the first msg will be sent once "queue button" is pressed. Then after 5 mins, second msg will send to queue. After next 5mins, third msg will send to queue.
For other buttons"QUEUE EVENT 2" in FP, I only need to send one msg once button is pressed.
I plan to use time elapsed vi to control time. when time is elapsed, 2nd msg is sent. How about third msg? How can I send it? Do I need to put another elapsed VI in producer loop?
I attached my VI.
Thanks for your help
11-19-2012 03:44 AM
Hi Dragon,
What about the condition where the first button is pressed, and the three messages are in the process of sending, and the user pushes the second button? Do you want an interupt or do you want to stack the sequence of events? If the second is the required option you could use a cluster to hold the parameters of the execution, such as number of tests and duration between tests. See the VI I have attached, it's perfect as I did it quickly while I was waiting for a compile but Im sure it covers most of hat you want! If you have any questions let me know.
11-19-2012 11:15 AM
Hello
Amfax.
Thanks for your help
In my appication, these two boolean controls on FP are independent each other.
Main thing is frst control. which need to send 3 messages continuously but with different time delay
I looked at your code. Idea is good. It gave me some ideas.
I think for short delay time. your code works good
In my project, I may need to send message probably half hours later or 2 hours later ....So if I have a emergency , I need to stop loop immediately.
Do you have any other idea?
11-19-2012 11:25 AM
Hi Dragon,
I have given you a good framework for which to base your application on. I would suggest that if you are still struggling look at tutorials online or examples to help you come to a workable solution. You could replicate the consumer loop and queues to expand to a second set of tests. You could replace the delay with an elapsed time VI and a user generated event or any other workable solution, as they say, there are many ways to skin a cat. Good Luck!
11-19-2012 11:47 AM
I plan to use queue to record the time when first button is pressed. And add one more loop to calculate the time difference between current time and time recorded in queue. then use some logic to send statemachine message. I think this may be better since my project is very complicated which includes many PC loop and DAQ loop
Thanks