LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx - merging device name and channel names ?

Hi all,

 

There is probably a extremly simple solution to this, but I didn't manage to find it !

I use LabView 2009 and 2010.

 

I'd like to concatenate the strings "Dev4" (device chosen by the user in the GUI) and e.g. "PFI0" to get a string that I could connect directly to a DAQmx vi.

Is it possible to do that ?

 

Thanks a lot for your help !

 

JB

____________________
JB
0 Kudos
Message 1 of 14
(3,617 Views)

You should be able to wire it direct, if not you use the attached vi.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 2 of 14
(3,611 Views)

Hi,

 

Thanks for your answer.

However, I don't know what you mean by "wire it direct", and I cannot open your vi either with LV 2009 or 2010.

 

Thanks,

Cheers,

JB

____________________
JB
0 Kudos
Message 3 of 14
(3,607 Views)

Just do a variant to data as shown, make this in to a vi.

test.png


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to the Test Automation user group: UK Test Automation Group
0 Kudos
Message 4 of 14
(3,605 Views)

Hi,

 

In the help of labview, look for "Physical Channel Syntax", you have the description of daqmx channel syntax.

 

With this you can use string to generate your daqmx channels (see the screenshot).

 

Yoann

0 Kudos
Message 5 of 14
(3,601 Views)

Great, thanks a lot !

____________________
JB
0 Kudos
Message 6 of 14
(3,595 Views)

Hi,

 

I'm back again with this problem.

Concatenating strings works fine for strings like "Dev3/ai0" for example, like this:

 

Capture d’écran 2012-11-07 à 14.57.16.png

 

but when I try to do the same kind of thing for a ai trigger source (in my case "/Dev3/PFI1"), it doesn't work. Here is how I try to do it:

 

Capture d’écran 2012-11-07 à 14.55.49.png

 

When I put a probe on the wire at the far right of the screen capture above, I get what I want, ie "/Dev3/PF1", but no trigger are received and there is no error message. Everything works fine when I simply use a constant like this:

 

Capture d’écran 2012-11-07 à 15.17.52.png

 

I don't really understand why it doesn't work. Any clue ?

Thanks for your help !!

 

 

 

 

 

 

____________________
JB
0 Kudos
Message 7 of 14
(3,539 Views)

Maybe it is because the name you are using are not the same as the port

You use PF1, but the name in should be PFI1

Message 8 of 14
(3,532 Views)

@dkfire wrote:

Maybe it is because the name you are using are not the same as the port

You use PF1, but the name in should be PFI1


And you really do not need the varient to data function.  DAQmx actually looks up those purple wires by the string displayed in the control wired in anyway so only the string is important.  Wire in a string and you are good to go.


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 14
(3,528 Views)

 

Ooooops !

It works... I really need new glasses ! Smiley Embarassed

 

All the best,

JB

____________________
JB
0 Kudos
Message 10 of 14
(3,521 Views)