DAQmx channel from string

I am attempting to abstract from the user the internal routing of counters in my DAQ tasks.  So, on the front panel I have a device name control to which I want to add the specific channels to in my code.  The only way I can think to do this is to cast the device name to a string and concatenate the channel to it (e.g. "Ctr0InternalOutput"), but how can I get from this string to a single channel that can be used as the source for a DAQmx timing vi?  Unflatten channel doesn't seem to work as this just ouputs a string and I need an NI terminal type.
Cheers
Solved!
Go to Solution.

As far as I know you can treat it as a string. Just concatenate. (Note the forward slash)
If you really want it to be the right type (rather than let LabVIEW typecast it for you) you could insert a typecast.
Troy
CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
Beware of the man who won't be bothered with details. - William Feather
The greatest of faults is to be conscious of none. - Thomas Carlyle
Attachments:
device-counter.png ‏13 KB
device-counter2.png ‏14 KB

Similar Messages

  • 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

    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
    Attachments:
    String to Enum.png ‏11 KB

  • Change a DAQmx channel property for a single channel from a channel group

    Hi,
    I'm doing some digital output, and I'd like to tristate certain lines in each port. However, I'm having difficulty figuring out how to specify which individual lines to tristate. I input a port and a line range, e.g. PXI-6533/port0/line0:7, specify to use one channel for each line in the DAQmx Create Virtual Channel VI, retrieve the channels from the DAQmx Task Property, and try to operate on the individual channels that way.  However, this results in the following error:
    Error -200428 occurred at Property Node DAQmx Channel (arg 1) in tristate_test.vi
    Possible reason(s):
    Measurements: Value passed to the Task/Channels In control is invalid.
    The value must refer to a valid task or valid virtual channels.
    Task Name: PXI-6533/port0/line0
    The NI knowledge base article that deals with this error code talks about creating a task with the DAQ assistant, or ensuring that a task has been created. However, I'm not using the DAQ assistant, as my I/O is pretty complicated; I'm just using a bunch of virtual channels. 
    Is there a way to specify individual channels to changethe properties of without having to create additional virtual channels? I have 48 digital channels I plan to use, so the less virtual channels I have to create the better. 
    Please reference the attached VI, which demonstrates the problem I am facing. 
    Thanks for any assistance. 
    Attachments:
    tristate_test.vi ‏11 KB

    You can only software-time tristate for the 6533/6534. Have a look at the attached example.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies
    Attachments:
    tristate6533.vi ‏58 KB

  • Remove channel from DAQmx AI task - reconfigure existing task

    Is there still no way to remove an AI channel from an existing DAQmx task? I know that it's possible to add a channel to a task using DAQmxCreateAIVoltageChan.
    Removing seems to be possible only by clearing the task and creating a new one, but this ends up in error -50103 (The Specified Resource is Reserved.) at creating and clearing a task continuously (after ~ 100 - 1000 iterations).
    Measuring device is USB-6225.
    Any idea ?

    Unless you want to learn how to do this with the Excel add-on called Measure, you should post to the much more appropriate Multfunction DAQ board.

  • How to remove channel from DAQmx Task

    I need to add remove channels from the task programmatically. How can I achieve it.
    Also while downloading my program to RT controller my system stops responding if I have DAQmx timing VI in my program. My program is running fine on windows system with DAQmx Timing.

    How are you using the DAQmx Create Task.vi? Are you using it to include a global channel or copy a task that was previously created in Measurement and Automation Explorer (MAX)? If this is the case the only way to remove a channel would be to delete the global channel or modify the physical channels for that task in MAX. If you are creating a new task you can use the DAQmx Create Channel.vi to specify the physical channels that you would like to include or exclude.
    Regards,
    Andy F.
    Applications Engineer
    National Instruments
    National Instruments

  • Extract single channel from DAQmx Task

    Hello,
    I have created a DAQmx output task, which contains two channels.  Is it possible to extract individual virtual channels from the task to be processed by two parallel processes?  I have tried bringing out the Channels Property using a Task Property Node, but I then get the error that the channel is not part of an active task (see attached snippet)
    Could anyone advise on a better approach, or how to acheive this functionality - if it is possible?
    Regards
    Dave
    Solved!
    Go to Solution.
    Attachments:
    split out channels from DAQmx task.png ‏34 KB

    Sorry, that VI does not make much sense. You have to use a single DAQmx Write for both channels and for 1 Sample mode, you simply have to build an array of the signals as shown below.
    Attachments:
    two channel write.png ‏12 KB

  • How can I read channels from different SCXI modules simultaneu​sly?

    Hello.
    I have a system that consists in:
    - Three E-series DAQ boards (PCI-6034, PCI-6052 & PCI-MIO-16E)
    - One SCXI chassis (SCXI 1001)
    - 4 SCXI modules for voltage measurement connected to PCI MIO 16E
    - One SCXI module for strain gauges connected to PCI 6034
    - One SCXI module for accelerometers connected to PCI 6052
    I have to develop a software application that reads all the channels at the same time or at least in the same program cycle. I have tried to create only one DAQmx task containing all the channels, although they belong to different DAQ boards (and SCXI modules, of course), but it seems to be impossible to use channels from different devices in the same task.
    So I have created three different DAQmx tasks, one for each device and its channels. I have used one "DAQmx Start Task" VI for each task at the beggining of the loop in order to use them independently, reading their channels inside the loop in every program cycle.
    When I have run the program I have get the following error:
    "ERROR -200619 ocurred at DAQmx Start Task.vi
    Chassis cannot be used for more than one scanning operation at the same time.
    Do only one scanning operation or combine multiple scanning operations into a single operation."
    What is the problem? How can I combine these multiple scanning operations? What can I do to read all channels at the same time?
    Thanks.

    Hello pablomendana,
    it's ok that you got an error when trying to use more than one device on the same task. According to the setup you have, I agree that 3 tasks should be put in place.
    The key question I have is... Have you configured manually at MAX the SG and accel. modules to be in Parallel mode?
    I would not expect the error you get if they are in parallel mode (in which you could even read directly from the DAQ board, using DAQ device channels instead of SCXI channels).
    Unfortunately, I haven't been able to setup a system similar to yours, but I would like to know more details on what you've tried so far.
    Also, I recommend you that if still need help on setting up the system, use NI's SSP program to get support from your local NI Application Engineering organization, as this will be faster than the forum.
    Regards,
    Jorge M.

  • How to get the list (vector) of selected channels from the portal

    Hi,
    I try to retrieve the selected channels from the portal to use them in my script. I use "DataCheckChnls". Is it possible to convert it to a vector, to use it after in in for next structure.
    I would like to do specific calculus for each selected channel. Must I use another method ?
    Thank's in advance.

    Hello!
    Sorry, I trusted the DIAdem help and did not testetd it. But I'm not completly wrong
    What you get is an array of strings containing the channel name. In standard use these names are unique and could be transfered to a channel numbers with the CNo command. Try this code to understand this:
    Option Explicit
    Dim aoChannels
    Dim oChannel
    aoChannels = ChnStrToChnList(DataCheckChnls)
    For Each oChannel In aoChannels
    MsgBox CNo(oChannel)
    Next
    If you realy need the numbers as array you can build a function to do this based on this code:
    Option Explicit
    Dim i
    Dim aoChannels
    Dim anChannels
    aoChannels = ChnStrToChnList(DataCheckChnls)
    ReDim anChannels(UBound(aoChannels))
    For i=0 To UBound(aoChannels)
    anChannels = CNo(aoChannels(i))
    Next
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How do i pass a daqmx task from labview to matlab using the math interface toolkit?

    I want to use DAQMX functions from Matlab using the Math Interface Toolkit (MIT). How can I have a labview function output (return) the DAQMX task to matlab via the MIT?
    I want to do this so I can start a DAQMX task in Labview from a matlab function and return control to matlab without losing the task.

    Hi Mark,
    (I already posted this answer in your other thread, but let's keep THIS thread alive - it makes more sense here in the LabVIEW forum than in Instrument Control forum.)
    Since the DAQmx Task is not a native data type that can be passed directly to MATLAB from LAbVIEW, try flattening the DAQmx Task to a string before passing to MATLAB. However, I doubt that you can access the task from within MATLAB, but feel free to give it a try.
    Good luck!
    - Philip Courtois, Thinkbot Solutions

  • Multiple channels from Signal Express

    I have 3 channels from a NI9219 from which I read a Voltage, Thermocouple and RTD at 1000 samples/s for 1000 samples then calculate the DC level for them, display and log.
    Unfortunately when I export to Excel, each channel appears in a separate worksheet, even if they were on one dataview during playback. How do I set the recording so that each channel appears in a separate column in one worksheet ?

    Hi JPP,
    What you should do is to log the data to
    an ASCII file as you currently are, then open the file in Excel. It will open
    as one worksheet.
    It is expected behavior for channel data
    to appear in a separate worksheet when exporting data directly from
    SignalExpress to Excel. It can be seen that the “Export to Microsoft Excel” option
    appears the same whether done from the DAQmx Acquire step or the Save to
    ASCII/LVM step, and is independent of the file options in the Save to ASCII/LVM
    step (such as one X column for time, or one for each data channel).
    If you would like to see different
    behavior, I would encourage you to visit ni.com/contact and submit a product
    suggestion in the lower left. Thank you.
    Importing and Exporting Data in LabVIEW SignalExpress
    Mark E.
    Precision DC Product Support Engineer
    National Instruments
    Digital Multimeters (DMMs) and LCR Meters
    Programmable Power Supplies and Source Measure Units

  • Accessing DAQmx channel information without DAQmx device attached to system.

    I am currently writing a LabView VI that makes use of a PXI-6229 card on a seperate chassis. The chassis is connected to a seperate computer from the one that I am using to develope the program. My problem is that I need to be able to obtain the DAQmx channel settings for various global channels, but since I don't have the DAQmx card attached to the system, I can't create global channels, and I can't set the channel nodes to return the data I need. In example, I need to be able to retrieve the Max and Min values for a voltage channel, but the channel properties node only lets me access/see the properties Active Channel, Channel Type, Physical Channel Name, and Description. Is there anyway to define a simulated channel for purposes of programming without the DAQmx card being there?
    I'm trying to avoid defining the channels at run time by using globals, but if I need to, I can define them via config file and pull the settings off that as well.
    Jon D
    Certified LabVIEW Developer.

    It is possible to have a DAQmx global channel in MAX without having the DAQ Device in that system. You will need to create the global channel in MAX on the system that does have the DAQ Device. Then select File>>Export in MAX on that system to create a .nce configuration file for MAX. You can then load that file into MAX on your development system by selecting File>>Import. That will import your global channels into MAX on your development system. However, they will show up in MAX with a red X next to them indicating that the device is not present.
    -Alan A.

  • How to Programmatically Set Scale on DAQmx Channel? Possible LabView Bug?

    Hi folks.  I have researched this question here on the forums and think I know what I need to do, but it doesn't work.
    What I'm Trying to Do
    I am creating a DAQmx Analog Out task that will write to a dozen channels.  I would like to set the scale on each of those channels to one of a handful of custom scales that I've already defined in my project.  From reading various posts on this forum, it sounds like I want to pull each channel out of the task using the DAQmx Task property node, then set each scale by writing to the AO.CustomScaleName property within the DAQmx Channel property node.  See the attached screenshots and VI file.
    The Problem
    I keep getting error 200378 "Custom scale specified does not exist".  The custom scale definitely exists in the project, but the VI won't recognize it.  It sounds similar to the bug described in this thread:  http://forums.ni.com/t5/LabVIEW/Why-do-I-receive-Error-200378-quot-Custom-scale-specified-does/td-p/...  However, I've tried the various workarounds mentioned in that thread (opening VI outside of project, then from within project, etc) and I don't get any different results.  I'm running LV 8.6.1
    Questions
    Does this VI work for anyone else once you've defined a custom scale with the same name as the one in the VI?
    Am I doing something obviously wrong?
    Is there a better way to do this?
    Thanks for any advice, it is much appreciated.  I've attached screenshots of both the VI and the Project window showing the custom scale exists, and I've attached the VI itself.
    Attachments:
    custom_scale_screenshot.JPG ‏38 KB
    project_explorer.JPG ‏68 KB
    daqmx_task_property_nodes.vi ‏64 KB

    This workaround isn't exactly what you are trying to do, but I have made a set of VI's that will let you open up the DAQmx Assistants from LabVIEW code programmatically.
    Programmatically Call NI DAQmx Assistants
    You can call the VI to edit a channel and manually reassign the scale if you want to avoid going straight to MAX.

  • Network bound variable on daqmx channels

    Hi all,
    I have a VI that runs fine reading data through Daqmx.
    I also have a 2nd vi running on another pc that has network shared variables bound to some digital in daqmx channels on the 1st PC.
    The problem is if i run this at the same time as my 1st vi,my 1st vi no longer processes the digital inputs (i.e.i switch to on and off and nothing happens), do i need to create network shared variables that i populate from the daqmx ones on the first pc and read those across?, im just wondering if its because you cant read the daqmx channels through the daqmx vis and also try to read them through network bound variables?
    hope that makes sense
    Mike

    Duplicate post.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Feature Request:  Modify Audio Channels from the Timeline in Premiere CC.1

    Why have we never been able to modify audio channels once a clip is added to a sequence?  I'm guessing there's a good reason Adobe has never had this feature.  The lack of this feature is explicitly mentioned a few times in the audio section of the Premiere Pro CC manual, as if it's a benefit NOT to have it.  But the benefit is entirely lost on me. 
    In my workflow, I synchronize my double-system video and audio before anything else.  I do this in PluralEyes (and unfortunately I'll have to keep doing it this way, until PPr's sync on sound feature gets fixed—for me it's never worked).
    Once PluralEyes has synched hours of footage and audio and placed it on a PLURALEYES GENERATED sequence, I import that sequence into Premiere.  Note:  Since I haven't gone through the step of creating a blank New Sequence, I don't get the opportunity to setup my audio channels the way I'd like in my sequence (i.e. Stereo recordings should occupy ONE track, not two.  Typically these tracks come from a camcorder and are used for reference sound, or ambient noise at best, so I don't need them taking up precious real estate in my sequence). 
    Since PluralEyes doesn't merge my clips for me (or rather I don't want it to since I'm usually doing multi-cam sequences where I want to keep all 14, or so, tracks of audio), I have to go through the clips one by one and do a Merge Clip action once I've adjusted any minor sync issues, or determined which tracks I actually want to keep.  But, and here's the key, at this stage I'm not yet 100% certain whether I'll use the nat sound or the wireless mic sound (separate audio recorder, etc).  Furthermore, I don't really want to think about that at this point.  After I've spent a few mind-numbing hours just ingesting files, sync and merges, I want to jump into the edit as soon as possible, before I lose all will to finish this edit.  If I modify my audio channels right now, I'll lose the ability to make some creative decisions later on.
    I'd like to start whacking out an assembly edit.  And then after I have a rough program, I can start looking at which audio tracks (nat or double-system) I like better in each circumstance.  This is where I become stumped that at this stage, I'm locked into whatever audio channels I've setup (or not) in the earliest stage of the edit, back before any media was actually on the timeline!  It's at this stage, and usually only at this stage that I want to start Modifying Channels—FROM THE TIMELINE!
    Does anyone else feel the same?  If not, what is your workflow?
    Feature Summary:  Right-click on any clip, (master clip, sub-clip, merged, nested or otherwise) in the timeline and choose Modify > Audio Channels.
    I've submitted a feature request, with a link back to this discussion, so please pipe in—especially if you want this feature. 

    Maybe its your specific workflow, asset mangement  and use of a 3rd party application that  runs you into an issue.
    Take Pluraleyes out of the equation, I would imagine my workflow is the same as most everyone else.  Find footage in the Media Browser.  Import it.  Create a Sequence and start editing.  Use the Source Monitor to set Ins and Outs and then Insert the clip on the timeline. 
    At this point, if the audio needs to be modified, it cannot be done on the Timeline.  The workaround, of course, is to Find Clip in Project; Modify Audio in the Project panel; then do a Matchframe to replace the audio clip.  This works, but requires many steps per clip.  Also, Matchframe in Premiere Pro CC is not reliable. 
    Introducing a new Modify Audio (from Timeline) feature as seen in the fantasy screenshot above would solve it.
    I dont use Pluraleyse ...which I understand to be a synching aid...so I dont know the workflow it imposes on one .
    Returning to Pluraleyes workflow, this issue is compounded by the need to Modify almost ALL audio.  Every stereo track is separated and placed on two MONO tracks taking up precious real estate.  This is not something Pluraleyes imposes.  It is due to the way Premiere imports XML timelines.  This would apply to sequences imported from Final Cut as well.
    In this case it would be ideal to select both the LEFT and RIGHT mono tracks and choose "Modify > Audio Channels > Merge L/R Mono to a Single Stereo track."  Ideal?  No.  I guess Ideal would be if Premiere would interpret XML files properly in the first place.
    What actually is the issue with Premieres synch and merge workflow in your case?
    Audio Sync in Premiere Pro doesn't work.  Period.

  • How can I extract the two channels from a stereo track?

    Hi,
    I am writing a class that is able to draw an audio signal. It seems to be working well but I have a question. If I load a mono audio file I am able to draw it on a graph by using the byte[] array and everything is ok until now. That's the code:
    void Draw(byte[] x)
                Graphics g=getGraphics();
                Graphics2D g2=(Graphics2D)g;
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                     RenderingHints.VALUE_ANTIALIAS_ON);
                for(int i=0; i<x.length-6; i++)
                    g2.draw(new Line2D.Float(((i*(getWidth()-6))/x.length)+5, (getHeight()/2)-          ((x*(getWidth()-6))/x.length), (((i+1)*(getWidth()-6))/x.length)+5, (getHeight()/2)-     ((x[i+1]*(getWidth()-6))/x.length)));
    The results is correct only if I have a mono track. Obviously when I get a stereo track the array becomes very large so here the question. How can I extract the two audio channels from a stereo track?
    Thanks in advance.
    Maurizio Di Vitto                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    A mono audio stream is stored [sample, sample, sample, sample], so just a list of samples in an array.
    A stereo sample is interleaved in the same manner, so you get [left-sample, right-sample, left-sample, right-sample]
    So every nth sample is the 1st channel, every nth+1 is the 2nd channel...

Maybe you are looking for

  • Complaints - Lack of response - Please Help!

    Here is a copy of an email that i have sent to BT twice in the last 4 days,  as yet i have not received a response or even an acknowlegement.  Hi I have a complaint about my BT bill that I tried to resolve with no success via telephone this morning.

  • Frame hangs when creating PDF

    I'm running Frame 8, unstructured, on Vista. Also running Distiller 8. I have a book file and was creating individual PDFs of the chapters doing Save As PDF on each chapter. After three weeks of doing this Frame starts to hang when creating the PDFs.

  • Attachment support in ebXML

    Hi, Is it possible to support attachments in ebxml protocol in Oracle B2B? If so, can you please give me the details or point me to the URL where I could get this. Is there a way to strip the attachment coming in the ebxml message and place it on som

  • Feather error in Illustrator CS4, CS5 (Win)

    caribou_areas.ai (.98MB) (alternatively caribou_areas.zip (959 Kb)) CS4 & CS5 Design Standard Intel Core 2 Duo CPU E8400 @ 3 GHz, 3 GB RAM Win XP (SP3)

  • Error -1074118625 with PXI-4071 and PXI-2527

    When using the LabVIEW IVI drivers for PXI-4071 and PXI-2527, I receive an error -1074118625 in TestStand.  The sequence initializes the MUX, init DMM, connects the MUX, waits for debounce, and then upon reading from the DMM, I receive this error. Er