05-02-2013 09:38 AM - edited 05-02-2013 09:39 AM
no... has to be something else. The workspace runs on windows so it all should work just like any windows VI.
(edit: removed the last part of this post, forgot that doesnt work!)
05-02-2013 11:02 AM
I implemented the selection dialog VI that you suggested. It pops up like it should but it doesn't display any channels to choose from even though there are plenty of them in the SDF. I even set the display filter to "K_ALL" to see if anything would show up but still no luck.
I am thinking that maybe it isn't referencing the proper workspace/SDF? I have a control named "NIVS.Gateway IP Address" to open up a workspace reference to use the Set/Get Channel Value VI's. I don't know if that is working or not to be honest - I got copied it from an example I saw but I suppose that could be a problem.
Also still haven't figured out why my event structure isn't working properly with the rest of the control. I didn't wire the "Cancle" output to anything from the Select Channel VI so I don't think that should have held anything. I'm sure it's some little thing somewhere that I haven't noticed yet though.
As always I appreciate the help with this - I feel like it's so close to working but just isn't there yet.
05-02-2013 11:02 AM
I implemented the selection dialog VI that you suggested. It pops up like it should but it doesn't display any channels to choose from even though there are plenty of them in the SDF. I even set the display filter to "K_ALL" to see if anything would show up but still no luck.
I am thinking that maybe it isn't referencing the proper workspace/SDF? I have a control named "NIVS.Gateway IP Address" to open up a workspace reference to use the Set/Get Channel Value VI's. I don't know if that is working or not to be honest - I got copied it from an example I saw but I suppose that could be a problem.
Also still haven't figured out why my event structure isn't working properly with the rest of the control. I didn't wire the "Cancle" output to anything from the Select Channel VI so I don't think that should have held anything. I'm sure it's some little thing somewhere that I haven't noticed yet though.
As always I appreciate the help with this - I feel like it's so close to working but just isn't there yet.
05-02-2013 11:07 AM
Make sure you have the sysdef ref wired into the channel selection dialog. You can just make a control off the sysdef ref input and place the control terminal in the left most sequence structure (it is only set at initialization). Then hide that control on your front panel.
I don't see why your events dont work... but there is no error handling in this. Probably should put in a simple error handler at the end so you can see what errors are happening.
05-03-2013 10:33 AM
Hey Joedowdle , have you gotten your workspace control to work yet? I had a similar issue with the select channel dialog box not populating when i looked at a similar control earlier.
05-03-2013 10:40 AM
I haven't had time to work on it anymore as some other more urgent things have come up - so no. I don't think I'll have a chance to look at it again until next week. I appreciate the assistance though.
I did add the error handler but haven't run it since yet. Also I do have the sysdef ref wired into the channel selection dialog so I'm not sure why it didn't work.
As always thanks for the help.
05-06-2013 02:48 PM - edited 05-06-2013 02:54 PM
So I got a chance to run it with the error handler in it. I get Error 91 - which is an invalid variant data type.
I initialized a string data-type before my init area of my code and so far there is no error and now I will check functionality.
Thanks for the help!
05-06-2013 03:27 PM
So everything works awesome - except of course one thing.
When I drop it on my workspace and select a channel it runs fine. Now if I close my workspace and reopen it, it doesn't remember what channel it was assigned to and resets itself.
I am positive that my initializing the empty string as my data-type is what is causing this but I am not sure how I can get around that since I get a variant data-type error if I don't have that there right now. And also how does VeriStand controls/indicators "remember" their assigned channel? I can't see to figure out where it might do that at.
Thanks.
05-06-2013 03:35 PM
to save any data for the next run of your widget, you can use the "generate user event" node where you send a cluster with the enum set to "setcustomdata" and the variant of whatever data you want to save. the reference to this event is available since the event is actually created in the init of your block diagram, its in the top left usually and its a pink event wire.
this is typically done whenever the user changes some setting you need to make persistent.
in your initialization where you convert that variant back to your persistent data (in your case a string), just ignore the error from this variant. If it errors, it means you never saved any data... which usually means this is the first run ever of your widget
05-06-2013 03:51 PM - edited 05-06-2013 03:51 PM
I set it up so it would ignore the error and it still doesn't "remember." From what you typed I believe that I have that set up properly.
The first circle is ignoring the variant datatype error and the second circle is where it uses the user event node.