05-11-2010 10:24 AM
Thsi is my first time experementing with functional globals
Having been recomended to read this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=240328&query.id=5387854#M240328
I have decided to start with just a functional global
(I like that term better as a FG should be just that, a global variable, and not perform any actions beyond holding data)
What I have is "VI-A" writing to the FG and "VI-B" reading the FG
The problem I am having is:
I can open the FG-VI in "VI-A" and see it updating.
If I open the FG-VI in "VI-B" the FG-VI is running but the controls and indicators are always in their default state and not being updated by VI-A
I have checked and checked and checked to make sure there is only one instance of the FG-VI on my machine.
I have even gone as far as dragging the FG-VI directly from the block diagram of "VI-A" to the block diagram of "VI-B"
Solved! Go to Solution.
05-11-2010 10:35 AM
05-11-2010 11:01 AM
Ok here you go, I have added VI-A and VI-B to the two main VI's in question and all the sub VI's should be there, but it's not like you can run it anyway without my test set up and one of our units...
I threw together the chg-cycle VI rather quickly, it's messy and it has gone through a few changes due to equipment failure...
So please no comments on my amateur programming style.
05-11-2010 11:10 AM
05-11-2010 11:16 AM - edited 05-11-2010 11:18 AM
Thats BAD!
05-11-2010 11:21 AM
Hi RTSLVU,
also throwing together two small test VIs to get rid of all your HW accesses, to show the FGV is working...
So maybe it wasn't a good idea to "I threw together the chg-cycle VI rather quickly, it's messy...". Remove the unwired default values and check again what's happening in your VIs!
05-11-2010 11:41 AM
GerdW wrote:Hi RTSLVU,
also throwing together two small test VIs to get rid of all your HW accesses, to show the FGV is working...
So maybe it wasn't a good idea to "I threw together the chg-cycle VI rather quickly, it's messy...". Remove the unwired default values and check again what's happening in your VIs!
Yeah well I am not using that VI anymre anyway, besides it was a quick and dirty test that worked fine the day I needed it... The origonal chg-cycle had the comunication VI's built in it. I was just using it to learn the FG concept. The idea I had was VI-A would run and continusly update so you could see what the UUT was doing and VI-B could pull in the data it needs from the FG... Like I do with my measurement instrument (The Measurments global in teh chg-cycle vi)
Anyway I changed the FG back to how I first made it (no unwired defaults), but it still does not work as expected. The read in VI-B is always empty
05-11-2010 11:56 AM
05-11-2010 12:00 PM
Look at this:
In fg screen1.jpg you can see CIB-FG.VI (opened from VI-A block diagram) being updated by "VI-A"
In fg screen2.jpg you can see CIB-FG.VI (opened from a new "VI-B" untitled block diagram that just reads the FG) and it is always in it's default state (empty)
05-11-2010 12:10 PM
for(imstuck) wrote:
Can you show the write case as it is now also? As far as the read case goes, that looks ok. Usually, you will place the controls in the write case, not outside the while loop.
Yeah, in the origonal thread I was looking at they said that putting the controls outside the loop has been benchmarked as faster then putting them inside...
I attached a snippet of one write case