LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variable not communicating with code

Hi all,

I am working on a project where I need to work with a code that came with a thermoelectric controller. Normally, I would just edit the code that came with the controller; however, the company I got the source code from did a horrible job of formatting the code, and it seems virtually impossible to work with due to the size (I tried the clean up function, but that only did so much). My plan was to create my own VI and make a shared variable that would interact with the source code, but I'm running into some issues. I need the shared variable to be able to take inputs (temperature values) from my own VI and output them into the source code, which I was able to do. However, I'm unable to get my shared variable to communicate with any other part of the code, I assume since it doesn't have a communications port. I need it to communicate with other functions, such as power output, otherwise I have no control over the power and I can only change the temperature. Is there a better way to go about doing this? It's possible that I'm going about this wrong, but I'm fairly new to Labview, so any help is appreciated. 

0 Kudos
Message 1 of 3
(1,109 Views)

Hi jgorski, thanks for using National Instrument's forums.

 

I believe I understand your problematic, nevertheless I'd like to ask more information about your project, so that the community can contribute better recommendations for you.

Is your VI in the same project as your controller VI? Are both in the same target (computer)? Your idea is to have the controller code (as messy as it is) communicate values to this other VI you're developing (both inputs and outputs, or just inputs)?

 

If the answer is Yes to the above questions, you might want to look for an FGV (Functional Global Variable), a Global Variable, or perhaps something more robust as a producer-consumer architecture using Queues.

 

Let us know if this information helps you.

Message 2 of 3
(1,075 Views)

Yes to all the questions. I'll check out the links, thanks!

0 Kudos
Message 3 of 3
(1,065 Views)