Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO and Event Structure on Raspberry pi

Solved!
Go to solution

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.

0 Kudos
Message 1 of 5
(2,304 Views)
Solution
Accepted by topic author Choke

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 5
(2,280 Views)

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.

 

Cattura.PNG

 

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

0 Kudos
Message 3 of 5
(1,909 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(1,900 Views)

@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?

David Wilt
The New Standard LLC
0 Kudos
Message 5 of 5
(1,897 Views)