LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I select a channel on the RT target with a VI on the host?

Maybe I'm trying to pound a square peg into a round hole, so please let me know if I'm abusing LV, but ...

I'm trying to parameterize our RT VI app that deals with digital output channels.  We use the same basic VI for multiple configurations.  The only thing that changes is the channel allocations.  So for instance, actuator 1 is on port0/line5 for one configuration and port1/line2 in another.  I really don't like the idea of modifying the VI every time we have a new configuration because it makes configuration management insane.  If I make a change to the basic VI, now I have to upate N copies of the VI and hope I catch everything.

So I'm making the main app VI read an XML configuration file that specifies all the allocations.  Sounds great at first, but how do I create the XML file?  I created a VI that manages the data in the VI, allowing the user to add/remove channels and edit the name and channel and then save it to an XML file.  The configuration is comopsed of an array of clusters, with the cluster containing the name and DAQmx channel.  My intent was to let the user select the channel from the list of valid channels by using the DAQmx Global Channel control.  But the problem is, the configure VI runs on the host, which doesn't see any of the channels because they are on the RT target.  But if I try to run the configure VI on the target, it refuses to deploy because I have GUI widgets.

Is my approach fundamentally flawed?  Is there a better way of parameterizing our VI?  Or is there a trick to getting access to the valid channels on the host VI?  The information MUST be available because after all, when I modify a target VI and select a global channel constant, I'm doing this on the host.

Thanks,
Keith.

0 Kudos
Message 1 of 7
(3,289 Views)
Hi Keith,
you can use TCP/IP to communicate with your RT system. Write a logic which search for you on the RT for the available ports and send it to your host computer. The User can now select the channel and you can send back the selected index. Configure your RT system and run it.

Hope it helps.
Mike
0 Kudos
Message 2 of 7
(3,280 Views)
I've never used TCP/IP in LabView (but I have a lot in C/C++).  How would I get TCP to hook up to a DAQmx Global Channel control on the host VI that allows me to select a channel on the target?

0 Kudos
Message 3 of 7
(3,277 Views)
You wouldn't really use a DAQmx control on the host PC because you wouldn't be able to populate it with channels that don't exist on the host PC.  You would use something like a text ring.
 
The RT system would send an array of strings that defines all of the available Daq channels on it.
The host system would populate a ring control with thost strings.
Once the user selects the appropriate channel, the host PC sends the selected ring text back to the RT system.
The RT system would take that text sent to it and  convert it to the DAQmx channel.
0 Kudos
Message 4 of 7
(3,266 Views)
OK I think I see.  BUt how can I convert a DAQmx channel to/from a string?

0 Kudos
Message 5 of 7
(3,262 Views)

Hi Keith,

you can handle the channels like "normal" strings. See the attached picture.

Hope it helps. Mike



Message Edited by MikeS81 on 07-25-2008 06:46 AM
0 Kudos
Message 6 of 7
(3,257 Views)
AHA!  I hadn't realized you could implicitly convert between a channel and a string.  That's exactly what I needed.  Thanks!

0 Kudos
Message 7 of 7
(3,244 Views)