04-05-2006 05:21 PM - edited 04-05-2006 05:21 PM
The FP Open and/or FP Create Tag VIs do not seem to read the IAK file every time. Here's the scenario: have a very basic (test) VI as shown below:
After a few tests, I decide to change some channel names. I have stopped my VI, but not quit LabVIEW. I go to MAX make the changes and save the IAK (it gets downloaded to my bank). I can see the new channel names in MAX and use them there just fine. Now, if I switch to my VI and change the item constant and run the VI, I get a tag not found error (32812). The FP Get Configuration Info.vi behaves the same, i.e., does not return the new channel name. Obviously, the IAK isn't being read again. It appears to be using a "cached" copy. Why is it not read every time?
A workaround I have found is to force a "refresh": drop a FieldPoint IO Control on the panel, Browse, and then force a Refresh using the button. Now the above VIs read the updated info'.
Any ideas why the IAK isn't read every time by the FP VIs?
-Khalid
PS: I know I should be using the latest-n-greatest FP IO Control.. but I don't want to in this case.
Message Edited by Khalid on 04-05-2006 04:26 PM
04-06-2006 04:37 PM
Yeah, the .iak file won't automatically refresh LabVIEW unless
you do one of the workarounds that you mentioned.
Fortunately there is a better way. If you use a FP I/O constant instead
of a string constant, then you can select Browse from the drop-down menu.
This will open up a dialog box and you can then click the Refresh button and it
will refresh LabVIEW looking at the .iak file.
Hope this helps,
04-07-2006 02:16 AM
Yeah, the .iak file won't automatically refresh LabVIEW unless you do one of the workarounds that you mentioned.
But why not? Shouldn't it? It's a bug, IMNSHO. Where is the documentation that says the FP Open VI doesn't read the IAK every time?
Fortunately there is a better way. If you use a FP I/O constant instead of a string constant, then you can select Browse from the drop-down menu. This will open up a dialog box and you can then click the Refresh button and it will refresh LabVIEW looking at the .iak file.
It's exactly same as my workaround -- I just suggested using the FP I/O control as an example -- and you're suggesting to use the constant for it. Same thing, eh?
In any case, I don't want to use the FP I/O control/constant -- because, in my application there are many tags and I build them programmatically by reading a config file and using the FP Create Tag VI. I used string constants to demonstarte the issue. In reality these values come from a file.
OK, granted that I won't be chaning the IAK when the app is running, but this is a pain during development and testing.
-Khalid
04-07-2006 05:41 AM
You can build an I/O point programmatically by concatenating strings and wiring the result string into the FP VI. I believe it will also survive configuration changes without needing a refresh, but I'm not sure.
@Khalid wrote:
In any case, I don't want to use the FP I/O control/constant -- because, in my application there are many tags and I build them programmatically by reading a config file and using the FP Create Tag VI.
04-07-2006 03:07 PM
Thanks tst; just tried it and it behaves the same way. Needs a forced refresh... aarghh!
-Khalid
04-07-2006 04:54 PM
04-07-2006 06:48 PM
Hi Otis,
Thank you; I just entered a suggestion. I must apologize for my tone in the earlier posts -- the frustration trickled into my words.
-Khalid
PS: I still think it's a bug...