USB-6525 - Programmat​ion VS2012 - GetSwitchR​elayPositi​on

Bonjour,
J'utilise un USB-6525 pour piloter (avec les sorties) le déplacement d'un chariot sur des rails. Différents fin de course sont positionnés et reliés aux entrées du 6525.
Le programme est développé en Visual Studio 2012 C#. La commande des sorties et la lecture des entrées se ont convenablement.
Par contre, je bute sur la lecture de l'état des relais de sortie.
J'utilise GetSwitchRelayPosition qui attend comme paramètre un string représentant le numéro du relais à lire. Je ne sais pas à quoi correspond ce nom.
Toutes mes tentatives se soldent par un exception :-(
Ci joint un exemple de code :
            Task digitalWriteTask4 = new Task();
            digitalWriteTask4.DOChannels.CreateChannel("Dev1/p​ort0/line4", "", ChannelLineGrouping.OneChannelForEachLine);
            DigitalSingleChannelWriter writer4 = new DigitalSingleChannelWriter(digitalWriteTask4.Strea​m);
            writer4.WriteSingleSampleSingleLine(true, ckbEtat.Checked);
            try
                // Lit la position du relais
                label1.Text = string.Format("{0}", DaqSystem.Local.GetSwitchRelayPosition("Dev1/port0​/line4"));
                //label1.Text = string.Format("{0}", DaqSystem.Local.GetSwitchRelayPosition("line4"));
                //label1.Text = string.Format("{0}", DaqSystem.Local.GetSwitchRelayPosition("4"));
                //label1.Text = string.Format("{0}", DaqSystem.Local.GetSwitchRelayPosition("output4"))​;
            catch (DaqException ex)
                MessageBox.Show(ex.Message);
Dans ce cas l'exception est : Relay name is not specified in the list entry avec un status code de : -200531
Merci de votre aide.
A+
Résolu !
Accéder à la solution.

Bonjour Luc,
Malheureusement cette propriété (GetRelayPosition) n'est pas supportée pour les USB-6525.
NI USB-6525 Supported Properties
J'ai fait le test avec une carte simulée (une PXI-2576) et la fonction GetRelayPosition("/PXI1Slot2/k0") renvoie bien l'état du relai (ouvert/fermé):
NI PXI-2576 Supported Properties
Si tu veux refaire le test par toi même, voici la procédure pour simuler un périphérique dans MAX
Bonne journée,
Valentin
Certified TestStand Architect
Certified LabVIEW Developer
National Instruments France
#adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
Travaux Pratiques d'initiation à LabVIEW et à la mesure
Du 2 au 23 octobre, partout en France

Similar Messages

  • Errors with contolling solenoid pump using a NI USB-6525 SSR

    Hi
    We are using a NI USB-6525 SSR to control four 24V solenoid pumps at frequency of around 1-2 Hz. We were told that this device could control a number pumps at the same time, but we keep getting the following error messages after about 20 minutes. We are unsure if it’s the device or whether its the vi’s for controlling the pumps that are problem. Each pump is run by turning each relay on and off every 400 ms. Attached is an example vi for one of teh pumps. Each pump has a separate vi’s and there can be up to four pump vi’s running at one time. Any thoughts on what problem might be would be appreciated.
    Note we have tried fiddling with the USB cables to the computer, but the issue still appears.
    Thanks
    Attachments:
    example of error messages.docx ‏172 KB
    Seawater pump 1.vi ‏31 KB

    Hello, Diatom
    Have you checked the power settings for the USB ports on your PC? It's possible that Windows is powering down the ports after a set time because of the power management settings. You can view these settings in the advanced menu of the Power Options on your PC.
    Regards,
    Ryan

  • Lien entrée/ sortie d'un USB-6525

    Bonjour a tous,
    N'ayant pas remarqué qu'il y avait une partie française j'ai déjà commencer le topic ailleurs, voici le lien:
    http://forums.ni.com/t5/Digital-I-O/USB-6525/m-p/1​954973#M15748
    Je vais essayer de tout réexpliquer clairement:
    Je dispose d'un USB-6525 et j'aimerait m'en servir afin de faire le lien entre labview et un banc de test "automatiser"
    Mon but étant que je puisse contrôler les relay par labview (ca c'est fait)
    mais aussi d'utiliser le 6525 afin de vérifier les signaux de fin de process.
    Une fois que mon système aura fait une action, il enverra un signal sur le 6525 par exemple en input0 et j'aimerait réussir a affiche sur labview dans un premier temps, des diodes de contrôles qui s'allume des que j'ai un signal puis dans un  second temps j'aimerai que ces signaux de contrôles  permettent de lancer la suite du processe , un peu comme un signal enable
    Processe1--> processe1 terminer, j'envoi un signal-->usb6525 reçoit le signal , une diode s'allume et sa lance le processe 2..
    Merci
    Cordialement rodolphe B.
    Résolu !
    Accéder à la solution.

    Bonjour Rodolphe,
    tout d'abord, je vous conseille pour ne pas partir de zéro de vous diriger vers le exemples LabVIEW (Aide>>Recherche d'exemples).
    Read Dig Chan.vi et Write Dig Port.vi sont les exemples les plus simples de mesure/génération numérique.
    Pour ce qui est de passer de 8 voies à une voie, c'est un problème classique de manipulation de tableau de booléens.
    Je vous ai joint un snippet qui montre comment accéder aux éléments d'un tableau de booléens grâce à une boucle ou au vi "indexer un tableau".
    Cordialement,
    Audrey_P
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Journées techniques : des fondamentaux aux dernières technologies pour la mesure et le contrôle/comm...
    Pièces jointes :
    TableauBooleen.png ‏19 KB

  • Controlling solenoids with USB-6525

    Hi, I am new to Labview and am trying to use a USB-6525 to control six indepedent solenoid valves.  They will be switching on and off at different frequencies to control a cell perfusion system.  I have designed a block diagram that allows me to set the times that the SSR is closed and open.  The routine is inside a While loop to repeat until a given time has elapsed.  I can duplicate this six times to allow each valve to be operated independently.  But I would like to trigger all tasks at the same time.  How can I synchronize the loops so they all start at the same time?  Will it suffice to put all loops inside a conditional loop, or will this run the tasks sequentially?
    Thanks
    Solved!
    Go to Solution.

    your can synchronizeyour while loops using notifiers, please see the attachment.
    Balaji(Certified Associate Developer)
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Synchronize.JPG ‏56 KB

  • NI USB-6525 Labview lib

    Does anyone know where I can get the labview drivers for the NI USB-6525 device. I have been searching but Idk if the device is new and the driver don't exist yet. If anyone has a link please let me know.
    Solved!
    Go to Solution.

    Do you have DaqMX installed?
    http://www.ni.com/download/ni-daqmx-14.1/4953/en/
    http://www.ni.com/dataacquisition/nidaqmx

  • Use NI USB-6525 with CANoe 7.2

    Hi,
    I would like to use the NI USB-6525 with Vector CANoe (Vers 7.2.38)
    Everything is allright when I use only inputs or only outputs.
    So my problem is when I use inputs and outputs in the same times.
    The response time to activate or to disactivate outputs is between 4 and 5 secondes.
    For the inputs, The response time is only one second.
    My OS is Windows Vista 32bits
    Thanks for your answer !

    Hi,
    The USB 6525 can only change 5 Times (operations)/Sec. If you
    need to change quicker than that, will need the PCI 6528. It can
    change every 5 ms.
    See p.14 for the USB 6225 and p.24 for the 6528.
    Hopfully this helps 
    Regards,
    Steve M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Vidéo-t'chats de l'été : présentations techniques et ingénieurs pour répondre à vos questions

  • USB 6525 reading back outputs

    Hi everyone/ni crew I have a small issue, which isn't a huge thing but would ease up our work a lot.
    We are using NI USB DIO (USB 6525), that are triggering in puts on our device(s) by setting the USB box outputs. It would be quite helpful to have a possibility to read back, which outputs of the usb box are currently set. I haven’t found anything in the LabVIEW DAQ subvis or the daq c++ drivers.
    Isn’t there a way to achieve this?
    As we are using LabVIEW to adress the NI USB 6525 box a VI solution would be my preference.
    thanks in advance
    thx
    Marcos V. Bischoff

    sry wrong forum
    thx
    Marcos V. Bischoff

  • USB-6525 & Diadem Max

    Hello,
    can anyone tell me if the NI USB-6525 is supported by DiaDem Max (Measurement & Automation)?
    Thanks, Jeff

    Hi Jeff,
    The USB-6525 is supported by DAQmx and this is a requirement for DIAdem. Most every hardware which is supported by DAQmx is supported by DIAdem as well - so the USB-6525, too.
    Greetings
    Walter

  • Remote testing of USB Peripheral Communicat​ions

    There are products that do USB loopback testing or do USB diagnostics from a DOS mode boot. If I could run a utility from a DOS prompt that provided diagnostics I could parse that'd be better. Microsoft also has a utility USB View which sounds promising, but it provides status with screens and nothing parseable from what I can tell.
    My challenge is to connect to an embedded system's various USB ports from the host PC conducting the tests and determine whether each of the ports is working. I need something more like an API that I can call functions from within LabView and determine programmatically whether each port is functioning. Sending some simple commands with responses would be enough. Has anyone any ideas on whether this could be done from LabView or am I facing some lengthy API function calling to accomplish this? Other approaches are also worth considering if they meet my limitations.

    How about plugin a thumb drive, wait a few seconds and let LabVIEW scan your computer for a file on the root of the drive.  If it finds it then port works, if it doesn't then it doesn't.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Using existing c code for usb-hid communicat​ion in labview

    Hello,
    I want to write a simple temperatrue logger using labview and a external hardware which communicates over usb-hid. The external hardware uses an ATMEL 90USB162 µC and DS18B20 sensors.
    Link to the hardware:
    http://www.diamex.de/dxshop/USB-Temperatur-Sensor-​Tester-fuer-DS18B20
    The source of a a simple command line tool is available (see attachement), which reads out the temperature value of the connected sensors.
    Is it possible to include this c-code in the labview application to simplify the communication?
    Thanks a lot and best regards,
    Michael
    Solved!
    Go to Solution.
    Attachments:
    CMDLINE.zip ‏17 KB

    I'm not that experienced at this personally (in terms of compiling C code into DLLs), but I believe the process you need to go down to call your C code in LabVIEW is to compile the C code into a DLL which you can then call from LabVIEW using a Call Library Function node (or you can try to use the "Import Shared Library" wizard to automatically generate SubVIs).
    There's more information here:
    http://digital.ni.com/public.nsf/allkb/DCB90714981​A1F148625731E00797C33
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Gamry potentiost​at and USB 6008 communicat​ion

    I dont really ever do any labview programming from scratch so my understanding of it is very basic. However I need to do the following and I was wondering what would be the best way to go about it.
    1. Run Gamry potentiostat (ref600) which at the end will send a digital signal out.
    2. USB-6008 used to read the digital signal
    3. Put a delay of around 10seconds.
    4. Run "motor control" VI.
    5. Put a delay of around 10seconds.
    6. Send a digital signal out.
    7. Gamry reads the digital signal and goes back to step 1.
    run this N number of times.

    rudresh wrote:
    Hi Wes,
    Thanks for the reply. It looks like I need something very similar to Simple state machine. However, I am using labview8.6 and was wondering if a similar example is available for the older version.
    Thanks again,
    Rudy
    Downgraded to LV8.6 for you.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    State Machine Example Project.zip ‏23 KB

  • Fieldpoint programmat​ion step

    Hi,
    I want to use labview to control my field point (read and write) but I don't even know how I can do that. I'm quiet lost at the beggining when they ask me to add the .iak file to my projet.
    Can someone help me please.
    Peter.
    Labview 2010

    Hi,
    We have a NI-488.2 beta driver at www.ni.com/linux.
    DiegoF.
    National Instruments

  • Using the 6525 counter to measure frequency: is there a neater way?

    I'm currently using the high speed counter on the a USB 6525 module to measure the frequency of a spinning object via a hall effect sensor.
    I was wondering if there was a simpler/ more effective way of coding it than this?
    Currently all I do is take the current counter reading, wait a second, take another reading and subtract one from the other. The result is the frequency, in hertz.
    Is there a way of getting the 6525 to return the count/ change in count after 1 second?
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    6525 frequency count LV8.vi ‏25 KB
    6525 frequency count LV2013.vi ‏15 KB

    Thanks for commenting. I'm not sure if I'm doing it right though or whether the NI USB 6525 can't handle this type of measurement?
    I keep on getting an error that says to effect it can't do this type of operation.
    Can you advise?
    Thanks
    Attachments:
    6525 frequency count LV9.vi ‏36 KB

  • What hardware should I use for TTL synchronization?

    I am searching for a hardware recommendation. Here's what the hardware should do: notify a PC program to run a subroutine upon detection of a TTL pulse (digital input change).
    So I need one 1-bit digital input, and the device should communicate with a computer via USB. The TTL pulse voltage is about 4.7 V. Since the synchronization must be fairly precise, the delay should be on the order of 1 ms or less. Therefore the hardware should have a sampling rate of at least 1 – 10 kS/s.
    I purchased the USB-6501 not realizing that it doesn't have any triggering or interrupt functionality, and now I don't think it will work for my application. I could constantly poll one of its inputs with my software to check for a change in value, but that would be relatively slow and hog my CPU. I would prefer that the device triggers or provides some kind of interrupt to my software application. I am considering using some NI software, but right now I'm using the session-based interface of the Data Acquisition Toolbox in the latest version of Matlab (R2013a, 64-bit) on 64-bit Windows 7.
    I think either the USB-6008, USB-6009, or USB-6525 might be a good option, but I'm not sure. I don't fully understand the difference between the triggering/interrupt capabilities of the USB-6008/9 and the USB-6525. Any advice?
    Solved!
    Go to Solution.

    Hello Brinmr,
    i do not hava license for matlab so i can not test it.
    On this page you found the supported NI hardware and here is the information the 6008 can be
    used in session mode Supported Hardware - National Instruments- NI-DAQmx
    and if i understand the function startForeground correct is this a session mode function.
    You can made some tests with a simulated 6321 or 6251, but if this also not works then you should contact
    the mathworks to ask them how you should implement your functions with mathlab.
    best regards
    Alexander Glasner
    AE NIE

  • Triggering an event with a digital input

    Hello all,
    I'm writing my first Labview program.  I used an architecture I found on the forums here, and it has been very helpful in getting me started.  This architecture uses two while loops, one containing an event structure and one containing a case structure.  (This is a queued state machine architecture, I believe).
    Part way through the programming, we decided we needed a sensor to make sure the part was in the test fixture during the test.  If the part is removed during the test, we'd like to safely stop the test.  So basically, I need to monitor a digital input (on an NI-USB-6525 module) and enter the "Stop" case if the digital input turns off.  I would also like to make sure this digital input is on before entering the "Start" case.  I don't care if the input changes state when the test is not running, nor do I care about its state during the "Exit" case.
    I'm really not sure how to add this functionality to my "stop" case.  I don't even know if it's possible.  I've been researching DAQmx events, but I haven't found an example or answer that aligns with my particular problem. 
    I've attached my code.  It's incomplete right now - I still have a large number of steps to add.  I wanted to get this issue figured out before I programmed any more steps.  A preview of the code showing the basic architecture is shown in the picture below.
    Does anyone have any ideas or suggestions for me, or questions if my problem is unclear?  Also, if you see anything else in my code that will be problematic, please let me know.
    Thanks in advance!
    Attachments:
    Main_Loop_072412.vi ‏195 KB

    I should also add that I looked into event dynamic registration, but it seemed incompatible with my issue.  I don't want my top loop to run only when an event triggers it - I want it to run all the time so that it can immediately respond to button presses. Also, most of the triggering I found was based on value change.  I care about the actual value, not just that it changed.
    I don't want to do anything that will bog the code down too much since it is important that the system respond immediately to inputs, especially to the stop or exit button presses.
    I'm sure I am missing something very basic here.  I'm used to ladder logic, where everything is simple and straightforward. 

Maybe you are looking for

  • Strange folder in my trash

    hello, i am finding the the trash, the folder "recovered files". inside the folder there is the file "wkresources". do you know what is this, and what does it mean? thank you for replaying

  • How do I open a port using "a shell" (Terminal)?

    There is a question hereabouts that deals with opening a TCP port using "a shell." The response says that this is possible but does not say how. Specifically I need to know this for Yosemite, most recent iteration. The port would be 8101, for Tivo De

  • I need help adding admob ads to air for android flash cs5.5 app

    I would like to know how can i add admob ads in adobe flash cs5.5 air for android app without buying any extentions please tell in detail because my scripting in as3 is VERY weak, so detailed answers would be lovely.

  • UCCX RTMT and CAD Agent Logs

    I have a CAD agent (version 7.0(1)) which uses the IPCC extension to make outbound calls.  My issue is with the RTMT showing these calls as Contacts Presented and Contacts Handled.  When the agent logs into the client to start their shift, they are s

  • Will I have to pay tax

    Hello, if I bought the MacBook from Asia, and I travel with them to Europe, will I have to pay tax at the airport?