09-27-2012 01:44 PM
I am trying to develop an application to turn 3 air valves on and off with time in between activations using a process that runs in the background. I am attempting to use user events to communicate to the background process which sequence of actuations to run at a given time. The problem I have run into is that I get error 1 from the generate user event function in the main program loop. I have read through all of the Nuggets, help files, and discussion posts I can find and I think that I understand how user events work and how to implement them. Or I thought I did. I can't find the issue in this program.
Can anyone help?
I have attached the project folder (zipped). The main program is called Black Hole Control, and the process loop that would run in the background is called sequence.
Thanks in advance,
Chuck
Solved! Go to Solution.
09-27-2012 02:13 PM
It looks like you are generating a user event before you create the event.
By the way, nice architecture.
09-27-2012 02:15 PM - edited 09-27-2012 02:16 PM
I made a slight change to your sequence and the error seemed to go away.
09-27-2012 04:10 PM
Can't believe I missed that. I must need a break from this. Now that the error is gone, what would prevent the event structure from picking up the generated event? I can watch the data flow through the generate event function (it's a little annoying not being able to verify that an actual event is generated), but the event structure never seems to notice.
09-27-2012 04:18 PM
Which event? The code you posted only appears to handle one of the three events you created.
09-27-2012 04:37 PM
The '<StateCtrl>: user event'. I have not implemented the others yet. I want to get this one working first as I consider it to be the most important one.
09-27-2012 04:40 PM
The code you posted has Timer Status setup for a user event. Have you changed this?
09-28-2012 07:21 AM
Yes. I decided that using a reference to the LED indicators would link the indicators more closely to the timers. The StateCtrl & ProgramStop user events are still used. Also, I have not yet coded a generate event function for either of the other 2 user events, I am trying to get the StateCtrl event working first since it is the most important event.
09-28-2012 07:26 AM
Can you post the updated code so someone can see if they can reproduce the behavior you're seeing?
09-28-2012 10:18 AM
Here is the latest version of the code...