LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO, Webservice (RESTful) and Frontpanel

Solved!
Go to solution

Hi there,

 

I created some simple webservice VIs for a larger application running on a cRIO. The webservice VIs can be used to send simple commands to the application and give feedback. So far I used a LV frontpanel for interaction with the system, but for several reasons I am looking for an alternative way to do this.

 

This worked fine in the development environment. After deploying the webservice VIs they communicated with the application as required and I am able to control the system using simple URLs typed in the browser address bar. Later on I will add static content, but for debugging this is fine.

 

The thing is that now I compiled and deployed the application, and now when I try to open the front panel I get this error message:
"Requested VI is broken and cannot be viewed or controlled."

 

Previously I did not use the NI-Application Web Server, so I installed it in order to be able to use web services. Are there any conflicts between Application Web Server and Remote Panel Server? Any suggestions on how to proceed?

I am using LV 2012 and NI RIO 12.0

 

Best regards,

Simo

0 Kudos
Message 1 of 4
(3,278 Views)

OK, so I built a mini project, and there it works. Maybe it's shared variable missing? Or some libraries not deployed properly?

 

How do I find the error? The controller is supposed to send a mail during startup, but it seems it won't come so far. At least I didn't receive any.

0 Kudos
Message 2 of 4
(3,262 Views)
Solution
Accepted by topic author SKauth

Hi Simo,

 

If I understand correctly you have the following setup:

cRIO with a LabVIEW Web Service and multiple Web Service VIs

 

Some ways to debug deployed LabVIEW Web Service VIs are:

You can have the LabVIEW Web Service deployed in debug and Remotely Debug the Web Service from LabVIEW on the desktop.

You can use a tool like Postman to make it easier to make requests and test your Web Service VIs (similar to going to the url in the browser).

You can create Desktop LabVIEW VIs using the HTTP Client Palette to test the Web Service.

 

You mentioned the following 'I compiled and deployed the application, and now when I try to open the front panel...'

 

I'm a little confused as to what Front Panel you are opening. For example, are you saying that a LabVIEW project was opened on the Desktop, the LabVIEW Web Service in the project was deployed to the cRIO RT target, and now when you open the Web Service VIs on the Desktop to look at the Front Panel you get an error message?


Milan
0 Kudos
Message 3 of 4
(3,198 Views)

Hi Milan,

 

thank you for your comments and hints regarding troubleshooting. I will have a look at Postman, maybe we can use it, but right now we are not ready to setup automated tests for the webservices. We still need to understand better, what needs to be tested.

 

Regarding the Frontpanel I am talking about: We built a larger application using one main front panel published by the web publishing tool for user interaction. This is intended for the experienced user only. In order to create an interface with limited functionality for the end user, we want to use webservices. So I am not trying to open the frontpanel of Web Service VIs, but the main application front panel.

 

Meanwhile I got the application running. I believe these were the reasons:

- I dragged a shared variable directly to the main front panel

- used a typedef to create another shared variable

- didn't include the shared variable lvlib as "Always included" in the main application's build specification

After fixing this, compilation and all interactions worked like in the development environment. But I was not able to reproduce the error in the mini project, So maybe it's a special combination, or there's something else conflicting in my project.

 

It would be nice, if NI could improve error reporting here (or disable the suspicious functions), as it took me quite some time with trial and error to figure out how to fix it. And I certainly will be tempted to use typedefs with shared variables in future. In fact I think I had this problem already once some time ago.

 

Simo

Message 4 of 4
(3,179 Views)