09-21-2017 07:11 AM
I'm programming a RT system with 3 drives which are accessed through the scan engine.
To control the entire system I have a producer state machine ("Command Loop") and for the drives I've created another state machine ("Motion Loop") which acts as consumer (see picture).
The Motion Loop gets it's Information passed via a RT shared variable fifo. But I would also like some control over the Motion loop when it's idle.
I've thought about using the event structure but am not sure if thats the best method.
I know LV offers several methods for me to communicate between loops, but is there a recommended method for my case?
09-21-2017 07:33 AM
I don't see anything that is being handled as time critical, so I would just use a queue.
09-22-2017 01:25 AM
Hello schpongo,
you can use a different framework like this from Delacor, which has the communication options inside
https://www.youtube.com/playlist?list=PLZ3A_SIOKdQs73IjbtaWwCSqoxQfxlWj6
or you can extend the JKI statemachine like crossrulz wrote with a queue or custom user events or notifiers.
09-22-2017 03:58 AM
@crossrulz wrote:
I don't see anything that is being handled as time critical, so I would just use a queue.
I'm not sure whether the communication between my AKD EtherCAT drives and the Motion Loop should be considered as time critical.
If it is, should I maybe consider using a RT FIFO instead of a queue?
The DQMH structure looks very interesting, but for the moment being I'm a bit short on time to look into it, but thanks for the tip.
Daniel
09-22-2017 04:31 AM
I'm not sure whether the communication between my AKD EtherCAT drives and the Motion Loop should be considered as time critical.
Can you show me the communication code mentioned here?
09-22-2017 04:55 AM
Hello schpongo,
now we are on a point where it is important to know what you want to do, becasue RT FIFO makes only sense, when also a timed loops will be used typical this means you want to make a controled closed loop.
09-22-2017 06:31 AM
Use “User Events” to communicate into the Event Structures of your JKI “state machines”. Use one User Event each, containing a cluster of a string (command) and a variant (data).
09-23-2017 05:58 AM
My current concept is based on one controlling loop which interpenetrates different user commands and commands which are read form a text file.
All the hardware which I need to control is supposed to be modeled as state machine.
The Motion loop is supposed to control 3 AKD drives via EtherCAT. Thus I thought about putting it in a timed loop so I could more tightly control how fast it runs maybe sync it to the scan engine rate.
At the moment I only plan to use the queue to initiate different automated processes for each of the state machines. So that they are in an idle state until they receive a certain command and then loop through different states.