Jump to content


Photo
- - - - -

Questions re: Shared Variables and cRIO


  • Please log in to reply
8 replies to this topic

#1 Daklu

Daklu

    Bringing the Fu to you

  • Premium Member
  • 1,776 posts
  • Location:Seattle
  • Version:LabVIEW 2009
  • Since:2006

Posted 18 June 2012 - 12:51 PM

I have a cRIO project that uses shared variables to transfer fp control states to the RT engine. The shared variable library is located under the RT target. Whenever I transfer the project source code to a different computer the shared variables used in the UI Main (under My Computer target) break, and I get errors stating the shared variables are not linked.

UI Main_BD.png

I suspect I'm misusing them somehow. Can anyone explain this behavior?


[Edit - The broken variables are actually digital I/O signals exposed via NI's Scan Engine. They are all related to one specific module; none of the other modules have this problem. I think these are the only Scan Engine variables that are used in the UI. Are Scan Engine variables supposed to be used only on the RT target? Is it "bad" to use them on a pc target?]

-----------------

I don't think this is directly related to what's happening above, but when opening UI Main I get this unusual error:

NoHardDisk.png

I've never seen this before. Cancelling lets the vi open normally (albeit broken due to the previous problem.) I'm guessing it's because I didn't set up a cRIO through NI Max on this pc?

Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.

Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.

There are two secrets to success:
Secret #1 - Never tell everything you know.


#2 asbo

asbo

    I have no idea what you're talking about... so:

  • V I Engineering, Inc.
  • 1,273 posts
  • Version:LabVIEW 2011
  • Since:2008

Posted 18 June 2012 - 03:13 PM

It is okay to use Scan Engine variables in your host application (I think they get published as network variables?), but I have little exposure to them so that's all I can say.

For the latter problem, have you tried a force re-compile? Someone else posted about that particular error on these forums a bit ago, but I forget who/when/where. I've seen this dialog (outside of the LabVIEW context) tied to hard drive corruption (run chkdsk /f?). Try pulling another copy out of version control and see if it still presents.

#3 ShaunR

ShaunR

    LabVIEW Archetype

  • Members
  • PipPipPipPipPipPip
  • 2,272 posts
  • Version:LabVIEW 2009
  • Since:1994

Posted 18 June 2012 - 04:58 PM

I don't think this is directly related to what's happening above, but when opening UI Main I get this unusual error:

NoHardDisk.png

I've never seen this before. Cancelling lets the vi open normally (albeit broken due to the previous problem.) I'm guessing it's because I didn't set up a cRIO through NI Max on this pc?

I have :angry:
Strange Disk Error

Try turning off Windows Defender.
A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort. (Herm Albright 1876-1944).

Founder and general mischief maker on www.labview-tools.com.
SQlite aficionado and websocket zealot.
If it 'aint in LabVIEW, then you 'aint got a clue!

#4 JamesMc86

JamesMc86

    Very Active

  • NI
  • 208 posts
  • Location:UK
  • Version:LabVIEW 2012
  • Since:2006

Posted 18 June 2012 - 07:25 PM

Can you still browse to the variables when you select the SV nodes? I presume it is the whole project that you are taking over as is.

The link is contained within the project so it doesn't matter if you haven't done anything in MAX with that cRIO. It would be interesting to know whether the two errors could be linked.

James McNally

AE Specialist, NI UK & Ireland & CLA


#5 Daklu

Daklu

    Bringing the Fu to you

  • Premium Member
  • 1,776 posts
  • Location:Seattle
  • Version:LabVIEW 2009
  • Since:2006

Posted 18 June 2012 - 10:06 PM

Thanks for the info Shaun and asbo. I'll try to track it down later when I have more time or get tired of dealing with it.


Can you still browse to the variables when you select the SV nodes?

Yep, I can still browse to the correct variables.


I presume it is the whole project that you are taking over as is.

Erm... sort of. The customer wanted a quick-and-dirty app to test and characterize a system they're building. I don't have much experience (or infrastructure code) with cRIO so I copied an existing project and heavily modified it. But yes, the entire project was copied to another pc using a usb stick.


It would be interesting to know whether the two errors could be linked.

Given the info from Shaun and asbo, I don't think it is. I have seen broken scan engine variables when the "no disk" error didn't appear.


----------------------------


Another question regarding shared variables: Are shared variables dynamically namespaced? I ask because something else occurred a while back I did not expect.

The shared variable library is located under the RT target. While working on the host app I noticed the shared variable library was showing up in dependencies, like how a vi used in the host app and RT app will show up under both targets. I moved the shared variable library from the dependencies and grouped it with the rest of my host app source code for convenience. That didn't work so well. Later on I discovered the variable YC-301 dragged from the pc target is not the same as YC-301 dragged from the cRIO target.

(As an aside, even though I am using the shared variables in the host app the shared variable library no longer shows up in the pc target dependencies. I have no idea why it was there in the first place or why it isn't there anymore.)

Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.

Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.

There are two secrets to success:
Secret #1 - Never tell everything you know.


#6 Jordan Kuehn

Jordan Kuehn

    Very Active

  • Premium Member
  • 239 posts
  • Location:Oklahoma
  • Version:LabVIEW 2011
  • Since:2009

Posted 19 June 2012 - 04:14 PM

Can you find the variables in the NI Distributed Systems Manager? If so, are they updating and reading correctly?
The Colex Group
Lead Software Engineer
Certified LabVIEW Developer

#7 Daklu

Daklu

    Bringing the Fu to you

  • Premium Member
  • 1,776 posts
  • Location:Seattle
  • Version:LabVIEW 2009
  • Since:2006

Posted 19 June 2012 - 06:14 PM

Can you find the variables in the NI Distributed Systems Manager?

Can't say, as I already repaired the broken code and am not too inclined to rebreak it to check. :)


If so, are they updating and reading correctly?

Doubtful. The variables in question are to give users direct control over digital output lines. Since the UI code is broken due to the error, the UI can't run and the values aren't updated.

Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.

Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.

There are two secrets to success:
Secret #1 - Never tell everything you know.


#8 Jordan Kuehn

Jordan Kuehn

    Very Active

  • Premium Member
  • 239 posts
  • Location:Oklahoma
  • Version:LabVIEW 2011
  • Since:2009

Posted 19 June 2012 - 07:06 PM

Doubtful. The variables in question are to give users direct control over digital output lines. Since the UI code is broken due to the error, the UI can't run and the values aren't updated.


The cRIO code should still be executing, and you can manipulate shared variables with the DSM. It can be a pretty handy tool when working with cRIOs. Won't get you inside the FPGA, but it can give you a peek inside the RT side and the CPU.
The Colex Group
Lead Software Engineer
Certified LabVIEW Developer

#9 Daklu

Daklu

    Bringing the Fu to you

  • Premium Member
  • 1,776 posts
  • Location:Seattle
  • Version:LabVIEW 2009
  • Since:2006

Posted 19 June 2012 - 07:10 PM

you can manipulate shared variables with the DSM.

Ahh, I see. Good question, I'll have to try that if I encounter the problem with a live system handy.

Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.

Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.

There are two secrets to success:
Secret #1 - Never tell everything you know.