0
Answered

Sequential execution/validation

David Dufour 4 years ago in IQANdesign • updated by Ulrik Zakariasson (Software development) 3 years ago 8
Hi,

I need to find the best method to do a sequencial communication.

Actually I need to send canopen packet in order and I need to respect this order.
As I can have multiple item, required or not (enabled/disabled) to send.

Case 1:

For example, with a scanreco remote control LCD screen I need to :

- Clear screen
- Activate FrameID of each component required to be visible on the screen
- after this I'll need to update each FrameID value with a 250ms timing.

Actually I was able to do this for testing purpose, but the program is a bit messy.

Case 2:

Sequential safety validation. Each step need to be validated in a specific sequence and in case of condition lost, I'll need to start again from the first step.

- Press "bypass" mode status on the screen
- Open the fence (Signal OFF)
- Close the fence (Signal ON
- Open the door (Signal OFF)
- Close the door (Signal ON)
- Activating bypass activated signal

In case of lost of the fence or door signal, I need to restart from the beginning this sequence.

I have in mind to use IDC + counter to do this, but I'm not sure to be in the right way.

I'm looking if you have example or recommendation to do this ?
I'm sure you notice that it's my very first project!

Best regards,

David
Would a state machine be useful here? You could link that to the channel that sends the packets.
Hi Jan,

I didn't use the states machine a lot for now, but it worth to be tested. My readings in the manual confirm your way.

I'll try today to use this to build the communication sequence.

regards,

David.
They are pretty powerful but not supereasy.

Consider also the following:
- You can use the feedbackloop you want to make the state machine switch to a different state.
- The states are now (still) in priority, so when two states can be active at the same time it will choose the first one in line.
Hi Jan,

I make some tests, but I'm not sure to be in the right direction.

For now, I can't obtain what I'm looking for.

The hardest point is to go backward in the sequence.

Regards,

David
If you want to go backwards and forwards step by step, maybe an event counter is better for you.

I thought you just wanted to restart from the beginning if something happened. (counters can also be reset so you have this as well).
+1
Hi,

One trick that I like to use for sequence controls is to build it with a combination of a State Parameter and an event counter channel. By making the ECNT the input to the SP, and then using the SP as the Function Selector on the ECNT, you can define transition condition for each states, where it can count up, down and reset depending on where you are in the sequence.


Attached is a small example:
Sequence state example.ids3
Hi Gustav,

Thanks for the example.

I'll check this and adapt it to my project, I think it's a better way.

Regards,

David