FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling a timed relay process and not using a sequence to do it

I am using the fieldpoint system with the RYL-421 module and am trying to control a step by step timed process to open and close valves to automoate a chemical synthesis in our lab, (i.e. relay 1,2,3 (valves 1,2,3) on for 30 seconds followed by Relay 2, 3 off and relay 1, 4,5 on for 2 seconds, ect). I have written a several panel sequence that works, however I am interested building a new program without using a sequence so that I can scale the application to many more additional steps than the three I currently have. What method would be the best to go with?

Thank you for your help.

Danny
Danny
0 Kudos
Message 1 of 6
(4,047 Views)
I think the simplest approach might be to build the 'recipe' into a cluster, then
create an array of steps (clusters).

You main loop then just reads the current array member, sets the valves accordingly
and loops for the specified time.

The cluster elements would be a boolean for each valve with a (real or int) number of
seconds the step should take.

The attached .vi shows the concept.  You would probably want to use a while loop
instead to allow for operator interaction (STOP NOW, etc.), typedef the cluster,
etc., etc., but this illustrates the idea.

Hope this helps.

Matt
0 Kudos
Message 2 of 6
(4,024 Views)
Matthew, thank you for your help. Your example code is exactly what I want to do, but with many more valves. You code looks so much nicer, and more scaleable than the sequence I wrote and have been using. This is the first time I have used labview and my learning curve has been steep and difficult. The lab here is planning on sending me to a labview course in December but until then i'm learning as I go. I could push the project off until after the course but software and the fieldpoint system are very cool I don't want to wait.

For a practice build, I tried to duplicate your code and have confused myself to the point of frustration. It's the basic building blocks i'm struggling with the most, i.e. what type of array did you use, how to get the constants into the array, how do you build the recipe, where should I start from, ect. I have been reading up on using clusters and array's in the two books I have but they are far from step by step guide and the examples are not very helpful. Could you recommend a good source that shows code examples with the step by step building process explained? Something like a dummies guide to labview?

Thank you for your help.

Best regards,

Danny
Danny
0 Kudos
Message 3 of 6
(3,995 Views)
Glad the sample was understandable.

As far as creating the array, try this:

1) on your block diagram, right click to the the functions palette.
2) mouse over the cluster box, probably 2nd row on the right (square with colored blocks)
3) left click on the cluster constant, probably bottom left, square with colored blocks again, and place on your diagram
4) right click to the function palette again
5) mouse over the boolean section, probably top right
6) left click on the True constant, probably bottom left, and place on your diagram
7) right click the boolean constant, select Visible Items and make the label visible.  Give it a name.
😎 drag the constant into the cluster box, repeat 4-8 for the number of valves required
9) using the same technique drop in a numeric constant for the timer
10) from the functions palette mouse over the array section, probably 2nd down in the middle, and
select the array constant, probably bottom left.  Place on your diagram.
11) drag the populated cluster into the array constant.
12) if you click and drag the corner of the array constant you can expand it to show multiple elements or
you can change the index display to show a specific element.
13) if you click on one of the boolean constants for a higher number index and change it's value then
the array will be populated with elements up to and including that one.
14) note that the for loop will run exactly once for each element that is populated

Unfortunately I don't know of a book but I am sure they are out there.  The forum archives can probably offer
some suggestions.  I got a lot out of the LV courses I took; I am sure waiting is frustrating 😉


Hope this helps.

Matt
0 Kudos
Message 4 of 6
(3,987 Views)
Matt, I can't thank you enough. Your step by step directions were great. Thank you again for your help.

Best regards,

Danny
Danny
0 Kudos
Message 5 of 6
(3,967 Views)
Thanks from me also Matthew, this seems to be the easiest approach to the timed recipe problem, my previous solution was horrendous.
I also included a seperate while loop to display the elapsed time every 100ms. Another approach might be to use the elapsed time vi to control
the program execution, but I think I will stick with your method, very flexible!

Cheers
0 Kudos
Message 6 of 6
(3,673 Views)