LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx physical channel to string

Hi Labview forum,

I have a variable DAQmx physical channel variable.
I would like to write the physical channel used to a file.
Is there a way to convert the physical channel selected to a string for writing to file?
Or to access a property node which stores the channel name in string format?

Regards,
Jamie
Using Labview version 8.0
0 Kudos
Message 1 of 8
(10,223 Views)
You can use the typecast function on the Numeric/Data Manipulation palette.
Message 2 of 8
(10,216 Views)
Thanks Ravens Fan,

that worked well
Using Labview version 8.0
0 Kudos
Message 3 of 8
(10,185 Views)

Can you tell me what is possibly wrong with this solution. I keep getting the error "One or more required inputs to this function are not wired or are wired incorrectly. Show the Context Help window to see what the connections to this function should be."

 

Untitled.png

 

The error is associated with the typecast and the physical channel.

0 Kudos
Message 4 of 8
(8,774 Views)

The type cast redefines the binary representation.  In this case, you will get a very wierd reference to who knows what.

 

What you really should be doing is use the Scan From String for both the Channel Type and the Physical Channel.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(8,757 Views)

I am not sure how to use "Scan from String" for these unique data types. Where can I find the format codes for physical channels and enums. I guess ENUM is U32 or something like that but I have no idea what a physical channel is.

0 Kudos
Message 6 of 8
(8,733 Views)
The input to the physical channel can be a string - 'dev1\ai0'. No conversion to unique data types.
0 Kudos
Message 7 of 8
(8,728 Views)

@LabVIEW1234 wrote:

I am not sure how to use "Scan from String" for these unique data types. Where can I find the format codes for physical channels and enums. I guess ENUM is U32 or something like that but I have no idea what a physical channel is.


You have to use the Scan From String to convert your string to the enum.  But as Dennis said, just wire your string straight into the Physical Channel input.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(8,712 Views)