Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/07/2021 in all areas

  1. I've been using the Statechart module for a while now, and find it really useful. I haven't yet seen any discussion of how best to put statecharts into practice (please share a link if there is one). Some things to discuss: Synchronous or asynchronous? How do you call the statechart? What architecture to use? Passing data in and out of the statechart: Do you stick to the input/output wires, or use other methods like queues, or vi server? As for me, I have built a couple of really big data acquisition and control systems using synchronous statecharts only. I have a three loop top level VI which deals almost entirely with the user interface. The first is an event loop which deals with button pressing etc., and passes the input cluster to a queue which is read by the second loop. This calls the statechart VI every 100ms or so. It dequeues the input cluster, runs the statechart, and passes the outputs to a third loop using queues. The third loop updates the display. All of the actual action (DAQ, logging etc.) takes place inside the statechart. As well as using the inputs, I also am using queues to send commands into the statechart (for example to trigger a transition; the queue ensures the command is only carried out once.) Its possible this could be accomplished by using the inbuilt statechart triggers, but I have not tried that yet. I have found a few difficulties to do with synchronisation of what is going in inside and outside the statechart vi, but in general the Statechart module is incredibly handy. For interest here is an example of the statechart I am currently working on. (N.b. I'll be using LuaView as well to implement scripting! The lua commands will send a user event to the vi which calls the statechart.). One benefit of the statechart is that it allows you to do tasks in parallel, while communicating over (for example) a single serial port, while not worrying about communication clashes, as each state is executed in sequence. I'd be very interested to hear about other people's experiences. Alex
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.