LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving and Using Global Variables

Hello everyone,

I am having difficulties by saving/using global variables.
Because of synchronization problem ,  I can see that the APIs I am using brings values , but do not send them to my test case eventhough they are connected per wires.

So as a solution i want to save the outcomes of those APIs to global variables , so I can use them afterwards in my test case.

The possible mistake I am thinking that I have done is a " synchronization Problem " which means " ; right after the APIs bring me the values( or simultaniously ) , it tries to run the test but somehow it doesn`t work. The way I see that Apis bring values is also with an API which shows me all the parameters I used in other program. SO the values are there , but the test case doesn`t start....

PLEASE HELP...
Thanks


p.s :  The problem can be seen on the picture that I have attached...





Message Edited by Support on 11-09-2007 08:35 AM
0 Kudos
Message 1 of 6
(3,141 Views)

I'm unclear on what you are trying to do and what is causing your problem. You say that due to synchronization problems you can see that the "API''s are bringing data (how do you see?) but that the function you are building doesn't execute. If there is data coming out of your "API" functions then the function connected should execute. Your issue is that you have no way to assure that all the API's have "executed" before the program moves on to your function. This is more dependent on the structure of how you call the API rather than trying to place their data into globals, which will essentially have the same problems (how would you know when the data in the globals was valid?). One possible answer is to put everything in a loop, poll the various API, possibly sequentially, looking for an output change, and not execute your function until all the API data has arrived. Have you run this with the "highlighting" turned on (little "light bulb" on the diagram toolbar)?

Give us a little more data on what happens with the API's (how you know they are supplying data).

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 6
(3,112 Views)
Use a property node to set each API to zero before execution.
Suggest you put a sequence frame first with property node in so that  they are zeroed before main frame (inclose all after first frame)
Thus you should then see a 'value' from other application on execution
That data could then be used to debug run you unexecutable vi.

chow
xseadog
0 Kudos
Message 3 of 6
(3,106 Views)
Dear LV_Pro,

first you ask me how do I know that the values are there ? 
answer: In the test case I wrote  , there is a Small API which shows me which kind of parameters I used in the other program,

secondly , You asked me how do I know that they are supplying data , because ( i tried this Bulb ) and all of those APis that I used had an outcome which was also true.


The main Idea of mine was this : I have a Power Supply , which is connected to an Oscilloscope , which has an fist and end values like ( from 0 v to 25 v ) , also incrementation steps are given ( you can choos ut ) and lastly you can choose the duration of a cycle.
So instead of giving those values from Labview manually, I will use  Interlab Software ( www.interlab.net ). There are APIs written to give values from Interlab and APIs work, but the test case doesn`t start....

see the vi for the complete Test case with out APis ,and the first one I posted is same program but the values come over APIs.

what do you think ?   :)))

0 Kudos
Message 4 of 6
(3,103 Views)
thank you for your answer , but what do you mean by " property node " ?

those APIs have the value of zero already before the test case starts ( theoretically start , in my case the don`t ! ) ...

pls see the vi attached...

0 Kudos
Message 5 of 6
(3,094 Views)
Wow
what can I say !!!
I have labelled case structures to explain.
Cases 1 ,2 & 3 are inline- notice error control so that dataflows from left to right( sequently).

In loop Loop case structure 4 it is not essential to place Number to fractional string  in case - it is only the numerical data
that you switch.

Stack sequence A I have not modified BUT see sequence B !
Notice that all three frames are now in only ONE  FRAME making debugging/reading easier.
Notice again error control ( so data flow Left to right)
Time delay should be coded outside express VI so that easier to understand how long delay is.( Time consuming to open front panel to see actual value. ALSO if you happen to use VI in other location and modify time delay on front panel this will be also reflected in all locations. Smarter to control via VI terminal.

In Stack sequence A you are firing the commands as quickly as Labview can execute them !!! Can your power supply
read and execute commands as quickly.  From experience I would suggest at least a delay of 300ms.

I have not attempted to tweak the merging of your expected signals.

Hopefully you can use principle to come further

Happy wiring
Xseadog

Message 6 of 6
(3,078 Views)