03-31-2021 09:08 AM
Hello everyone.
Several days ago I am trying to use the GPIO of my Rpi to generate events.
I understand that the best way to do this is to use "Event Structure" as it would save a lot of Rpi resources.
Unfortunately I have not been able to get the event structure to work using the GPIOs.
I consult, is it possible to make this type of structures run using the GPIOs?
For example, detect a pulse and have that pulse execute the event structure?
Thank you all.
Solved! Go to Solution.
03-31-2021 10:54 AM
That's because the Event Structure is not supported on the embedded side of things. It is meant to work with user interface controls, which a VI running on the RPi doesn't really have either. It's the same for LabVIEW on realtime targets.
08-24-2021 01:21 PM
Rolf,
I'm sorry but what you write is not entirely true.
The 'User Events' are also supported by embedded systems such as Raspberry Pi or cRIO, etc..
When creating an 'Event Structure' in an embedded system, the 'Dynamic Event Terminals' is shown by default. Using 'Create User Event' and 'Register For Events' it is possible to associate the 'User Events' to the 'Event Structure'. Please see the attached image example.
The still open question is:
Is it possible to associate GPIOs events or other Raspberry Pi events to the 'Event Structure'?
I am also looking for a solution!
Thanks for any suggestions,
Asper
08-24-2021 01:42 PM - edited 08-24-2021 01:44 PM
Yea, user events works, but generally that is an edge case of using the event structure. 99.5% of the times I use the event structure it is to use them in combination with front panel controls, and sparingly a user event mixed into it. I have virtually never created a program that used the event structure only for user events.
As to connecting external pins to user events, no that is definitely not supported. It could be added to Linx, but Linx needs many other features much more importantly to be implemented before this is even remotely interesting.
08-24-2021 01:52 PM
@asper wrote:
Rolf,
I'm sorry but what you write is not entirely true.
The 'User Events' are also supported by embedded systems such as Raspberry Pi or cRIO, etc..
When creating an 'Event Structure' in an embedded system, the 'Dynamic Event Terminals' is shown by default. Using 'Create User Event' and 'Register For Events' it is possible to associate the 'User Events' to the 'Event Structure'. Please see the attached image example.
Well yes a Dynamic User Event like that may work but what @rolfk was referring to was in relation to user interface controls.
@asper wrote:The still open question is:
Is it possible to associate GPIOs events or other Raspberry Pi events to the 'Event Structure'?
Are you specifically asking if you can register for GPIO signals like you can do with some DAQmx signals (https://forums.ni.com/t5/Example-Code/DAQmx-Change-Detection-Event-Registration/ta-p/3502871)? I assume that this is not possible, as it is not supported for all DAQmx signals, but I don't know for certain. See if you can get it to work with the information in this example.
Since you showed that Dynamic User Events worked, why not poll the GPIO in a parallel loop and when it changes trigger a Dynamic User Event and send it to the other control loop?