LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time sbRIO-9628

Hi,

I can't use the event structure in Real time , all I want is to figure out a solution when i press a button another vi appears in Real time  . I am using sbRIO 9628 .

Best Regard.

0 Kudos
Message 1 of 8
(1,888 Views)

Your sbRIO does not have a user interface. So having a front panel is basically not something you normally use. Sure during debugging of your real time application you can run the front panel on your Windows host system and LabVIEW transparently transfers the actual data between your front panel on your Windows computer and the actual software running on your RT system, but that is not realtime, it only gives you a regular snapshot of the data as present on the RT system.

 

Event handling in that respect would not work the way you are used to, since the TCP/IP latency between your front panel running on your host system and the actual programming running on the RT target would throw quite a few wrenches into this.

 

The first thing you need to realize is that programming in RT is in reality headless, which means without a direct UI to control the app. The way this is solved is by writing another application that runs on your Windows system and communicates through some means (shared variables, network streams, websocket, or your own self cooked TCP/IP protocol) with your RT system. But in general the RT app is usually designed to operate even without any client connected and just offers an optional way to change things through such an UI application on your host system.

 

For debugging purposes when wanting to use the remote front panel on your host directly you will need to resolve to polling. This means that in the loop where you would normally have your event structure, you need to poll all controls in regular (a few 100 ms is usually more than enough) intervals and act on their state change.

 

For boolean buttons set to one of the Latch actions you can directly use the boolean state to detect if the according event has occurred. For other controls you need to somehow store the previous iteration value in a loop shift register and compare it with the current value and if they are different you have an event. If your event handling loop is constructed as a state machine you can then directly push the according event state into your state machine shift register or queue.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 8
(1,864 Views)

Hi,

Thank you for your answer ,

I want to run as a startup my application in sbRIO and disconnect from windows.

What the reference of sbRIO that could do the thinks ?

Best Regard.

0 Kudos
Message 3 of 8
(1,841 Views)

@Emna20 wrote:

Hi,

Thank you for your answer ,

I want to run as a startup my application in sbRIO and disconnect from windows.

What the reference of sbRIO that could do the thinks ?


I do not understand what you are asking. When you develop an RT app, after having debugged it, you directly install (deply) it to the target from within the LabVIEW project. Right click on the Build Specification for your RT app, select "Deploy" and "Set as Startup" and then restart your target. That's all there is to it. The application will start up and run whenever the board gets powered.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 8
(1,831 Views)

Hi , 

Thank you .

My application is already run as a start up in sbRIO . I need to add a boolean button . and when i press this button another VI appear . I can't use the event structure method . what is the solution to use the event structure or another method . Could you please send to me an example of this .

Best Regard.

0 Kudos
Message 5 of 8
(1,826 Views)

Where do you want to have this boolean button to push? Where should that VI appear?

 

The sbRIO-9628 does not have a display on which it could display a front panel for you to push a button, and neither to display a VI that you want to pop-up. Forget the whole idea of a user interface on an embedded controller like the sbRIO-9628. It simply does not exist.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 8
(1,816 Views)

Hi ,

I don't know what you are talking about , but I could display a front panel using sbRIO, I also could press a button .

by activating the UI embaded in NI MAX. and making the program run as a startup .

Figure 1.PNG

0 Kudos
Message 7 of 8
(1,809 Views)

Ahhhh, I see, this board is one of the very few that has an embedded video controller. Sorry, I wasn't aware that there is an sbRIO board with that capability. I only knew about the high end cRIO-903x series with that capability.

 

I haven't really used the embedded UI so far and there are several limitations in what you can do on the embedded UI in comparison to a normal desktop system. So this is only an idea I have used in very old days, when LabVIEW did not have an event structure at all. It uses simple polling.

 

What you have to do is in your state machine when executing the "idle" state, check for the boolean you want to allow to open that panel, and if it is true, call in a case structure that subVI and configure it to Open its front panel in the VI options.

 

That's all. The most simple solution simply adds an additional loop to the diagram and looks something like the following but if you already have some kind of state machine loop you might be able to incorporate that. Just be aware that while your pop-up subVI is running, the loop in which it is called is stopped until the VI returns (closing alone is not enough, it really needs to stop executing):

 

Polling loop.png

 

 

Rolf Kalbermatter
My Blog
Message 8 of 8
(1,792 Views)