Instrument I/O Assistant:Convertir les commandes ASCII en numérique?

Bonjour à Tous,
Je suis à la recherche des exemples d'applications et des liens sur les assistants E/S d'instruments dans le but de développer un driver pour power supply Haut Voltage.
En effet ,dans le cadre de mon projet j'ai utilisé ces Assistants E/S directes pour communiquer (Commandes en ASCII ,Reponses en ASCII) avec des alimentations Haut Voltage de type MPS Spellman et le programme fonctionne très bien.
Pour la suite de mon travail je voudrai utilier des commandes Numériques (Décimal) sur la face avant du CODE VI standard obtenu après conversion et avoir des réponses en numérique pour l'exploitation (Ci joint le Code VI Réalisé)
EXP de commandes:  stx 12 EN1 Y lf = ON ( Enable )
                                    stx 12 EN0 z lf  = oFF (Disable)
                                    stx 12 V1=5 d lf : Pour appliquer 5Volt
,,,                               stx 12 V1=1000 X z lf : pour appliquer 1000 Volt
Je sais pas si des fonctions existent sous Labview ou il faut écrire un autre de programme de calcul?  si quelqu'un a des remarques ou des suggestions à faire,,elles seront les bienvenues  Merci à bientot.
Pièces jointes :
TEST22 MPS.vi ‏15 KB

Bonjour,
Si je comprends bien, vous souhaitez convertir un valeur ASCII en valeur numérique. Vous pouvez utilisez la structure suivante:
Cordialement
Mathieu B
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;}
Forum Aéronautique, Spatial et Défense. Avec la participation exceptionnelle de Bernard DUPRIEU, Res...

Similar Messages

  • Instrument I/O Assistant only reading the first command

    I am very, very new to LabVIEW and I am trying to program a device using ASCII codes.  When using the VI Instrument I/O Assistant only the first command is executed. So I am wondering if there is something obvious I am missing to make all the commands executed or a way to write multiple ASCII codes in one Write command?  Any help would be much appreciated. Thanks. 

    Rach_77 wrote:
    I am very, very new to LabVIEW and I am trying to program a device using ASCII codes.  When using the VI Instrument I/O Assistant only the first command is executed. So I am wondering if there is something obvious I am missing to make all the commands executed or a way to write multiple ASCII codes in one Write command?  Any help would be much appreciated. Thanks. 
    We could help (most likely anyway) and yes, If you are new to LabVIEW it may be obvious to those of us that can look at what you've done so far, (think: attach your code) and know what device you are trying to communicate with. (make and model at least - best Link to the manual as we may need it as a reference ) 
    Jeff

  • How to send multiple commands throught the Instrument I/O Assistant

        I am using the Instrument I/O Assistant to set up an instrument driver.  I am only using two rs 232 commands. The way I have the Instrument I/O Assistant setup is: first I have a default instrument setup step then I use a write step with the first command, then I read and parse, then I do a write command again with the second command and finally I read and parse again.  All of this works fine inside the window but  when I run it in my program  only the first  command's response it outputed . The second command's response is not outputted it just sends a null. Can the Instrument I/O Assistant only handle one read and write, or is my logic wrong?
    Thanks for your help
    Ian

    Hi Ian,
    You should be able to perform multiple reads/writes with the Instrument IO Assistant.  What termination character are you using?  I have seen cases where different termination results in different parsing, which may explain why you're only receiving a null character on your second read.  Thanks!
    Regards,
    Anna M.
    National Instruments

  • Instrument I/O Assistant (sending command from labview to arduino)

    Hi,
    I am a beginner in Labview. I would like to control the intensity of AC loads using labview. In this case, i would prefer to use instrument I/O assistant. The instrument I/O assistant in labview will have to send a command to Arduino. The intensity will be controlling by using slider in labview. How to write the vi for this example? Please advice.

    feliciacpw92 wrote:
    Hi,
    I am a beginner in Labview. I would like to control the intensity of AC loads using labview. In this case, i would prefer to use instrument I/O assistant. The instrument I/O assistant in labview will have to send a command to Arduino. The intensity will be controlling by using slider in labview. How to write the vi for this example? Please advice.
    In the thread for your other post, you were told that LabVIEW installs by default example programs on how to use LabVIEW with serial port.
    Have you bothered looking at that?
    You need to do some work on your own.

  • Help with Instrument I/O Assistant

    I am trying to control an Instrument with 'Instrument I/O Assistant. The control commands that the instrument expects are a ASCII character immediatly followed by a 'nul' character.
    If the instrument does not see the null character then it will not run the command. Is there a way of entering a 'null' character as ACSII?
    Also with 'Instrument I/O Assistant, What is the termination character \n? What do the termination characters do? 

    Unless there have been changes to the assistant in LabVIEW 8.x, you can't use it to send a NULL character. The termination character input is where you tell the assistant to append a specific control character at the end of each command and what character will terminate a read. The only options are \r (Carriage Return), \n (Line Feed), or \t (Tab). You need \00 which is the same as hex 00 and is the ASCII NULL character. You can create an assistant task and then convert to a regular subVI or just use the lower level VISA Write in the first place. There is a couple of shipping examples for serial communication. One has the front panel string control set for '\' Codes Display which does allow you to enter \00. The other sets the termination character with a VISA property node.

  • I want to communicate a RS485/2-wire device through COM1. I tried Instrument I/O Assistance to write to COM1(hex string with or without end bye:0D0A), something happened on the bus, but is not defirrential signal, and device didn't recognised them.

    I am new to LabView, so please bear with me...
    I tried to communicate with an RS485/2-wire device through COM1.  I used Instrument I/O Assistant (and Advanced/Basic Serial Write and Read examples) to write command (HEX string) to COM1,  
    tried writing HEX strings with and withour end bye (is 0D0A the correct end signal for HEX string?).  Both didn't get device's responce.  Looks like the device didn't recognize the command.
    I monitored the transmitted signals on the bus, they were not differential as supposed to be.....
    What is the possible reason to cause this? Please help...
    The hardware connection is OK, because I am able to communicate with the device through COM1 (with the same command) using different software application.

    How are you sending the hex? Is your string control set for hex display or normal? If it's set for normal, then if you send something like 'AD', then you aer sending the ASCII characters 'A' and 'D' and that's not the same thing. I don't believe the I/O assistant can send hex but you can modify the basic serial write and read to do so. Just right click on the string control and select 'Hex Display'. You can also enter the data in a numeric control (set for dex display) and use a type cast or an array of U8's and use the Byte Array to String function. Hex data usually doesn't use any kind of termination characters such as CR/LF.
    If communication is working with another app, then as you said, the hardware is okay and it's not a problem with differential signaling.

  • How do I program Instrument I/O Assistant to read a variable in the input string?

    How do I program the Instrument I/O Assistant to read a variable in the input string? I can manually type in the string using the Instrument I/O Assistant using the "Write" or "Query" tools but I do not know how to send a variable input to the Instrument I/O Assistant so that variable can be used inside the "Write" string. For example, I have a power supply whose current I want to set to X Amps. I can type the command "PC10" to program the current to 10 Amps, however I want to be able to program it at any arbitrary current. How do I feed the value X into the code for this purpose?

    You can't. The assistant was designed to be a quick and dirty way to do some basic communication with an instrument. You can turn it into a VI (right click and select Open Front Panel) and modify it so that your write string is an input to the VI or use it as a template and create your own code with VISA Read and Write primatives.

  • Instrument I/O Assistant Help - Parsing Errors

    Hello All - 
    I am having trouble working with a TSI DustTrak DRX - which does not have its own driver so I had to make one.  At this point, all I want to do is send a command to the instrument and get an indicator to repeat what the output is.  So far no luck.
    1) I think my driver works. The instrument is connected via ethernet. The instrument has a static IP.  In MAX when I look under "Network -Devices" it appears there. "Validate" results in a successful connection. If I click on "Open VISA Test Panel/Input/Output" I am able to enter commands (e.g., rdmn\r returns the instrument number) and "Query" and the correct answer comes up. It should be noted that the number of bytes returned for different commands are different, and also that the measurement data is always of variable length, so I often get the "Timeout expired before operation completed" error.  For a simple read instrument number command, the number of bytes is predictable, but for the measurement data, it is not, unfortunately.
    2) When I put an "Instrument I/O assistant" on the block diagram of a new VI, and add a "Query and Parse" step with the same command (rdmn - no \r this time), I again get the expected value (or when I query the measurement, rmmeas, I get the expected output string). Again, it should be noted I get the "Timeout expired before operation completed.   VISA Status code : bfff0015" error. Once I close then reopen the Instrument I/O Assistant configuration window (though not before) I can parse the data, and the token appears as a potential output of the VI. Here I can declare the output as either String or Number.
    a) If I declare the output as a string and create a string idicator, an empty string is returned.
    b) If I declare the output as a number (it is "8533", so this should be OK), I get the following error (even without creating an indicator before running): "Error 1 occurred at Scan From String (arg 1) in Untitled 5:Instance:0->Untitled 5 Possible reason(s): LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @."  I know from MAX that the returned value is actuall 8 bytes: \r\n8533\r\n . So, there are no unallowed characters here. And there are no paths involved - no read/write.
    Some other info:
    1) If I send start or stop commands to the instrument in MAX or the Instrument IO Assistant, I can get the instrument to turn on/off as it should, so I'm clearly comunicating to the instrument correctly.
    2) I get the same behavior if I parse the returned measurement string  - \r\n385,0.013,0.014,0.015,0.020,0.035,\r\n from MAX - as a set of numbers (that is, with "Error 1 occurred at Scan From String (arg 1) in Untitled 5:Instance:0->Untitled 5 Possible reason(s): LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.")
    Any help would be appreciated!
    Thanks.

    Hi James -  Thank you very much.  I actually found the problem and was able to fix by changing how the output text was parsed - the \r\n in front and back was confusing it - and making sure that I flushed the read buffer after reading, just in case. I also had to modify so that the first character was read and discarded before reading (and using) the rest of the output string.
    Now for a rookie question:  I've got it set up as a working VI now - how do I declare which variables are inputs and outputs when I put it in another vi?
    Thanks.

  • Instrument I/O Assistant and Graphing

    Does anyone know how to use data taken from an Instrument I/O Assistant Input and put it into the y values of a graph??  I'm having issues with this because it returns values like "v 0" and "v 256" but I need just the number value to get a graph to work.  Any advice would be very much appreciated.  Thanks in advance!
    Solved!
    Go to Solution.

    Hi Rach_77,
    In order to get rid of the "v ", you can use the String Subset Function and set the offset to 2.  This will take away the first two values and just give you the number.  From there, you will just have to convert the value to whatever type you would like.  I hope this helps!
    Kim W.
    Applications Engineer
    National Instruments

  • Instrument I/O assistant in runtime engine

    Hello,
    I currently use the Instrument I/O assistant in some of my VIs to communicate with an Agilent network analyser using SCPI commands.  This works fine, and I am able to do everything I want to do (on my desktop which has LabVIEW installed).
    I would like to be able to run my VIs on a laptop which does not have LabVIEW installed, using the free runtime engine.  I have successfully been able to do this with several VIs that do not contain the Instrument I/O assistant.
    However, I can't get any VIs that contain the assistant to work on the laptop.  I have verified that the connection between the laptop and the network analyser is OK in MAX, and all the device numbering and addressing is the same on the laptop as it is on the desktop.  I have even been able to get individual blocks such as "GPIB Write" to work on the laptop.
    Any ideas would be greatly appreciated.
    Cheers,
    Dan

    What version of LabVIEW are you using? For quite a while, you have had the option of creating an installer. This is the recomended way to distribute an exe. Prior to 8.x, you could include the LabVIEW run-time. Since 8.x, you have had the option of creating an installer that included hardware drivers such as GPIB, DAQmx, NI-VISA, etc. You could also download the VISA run-time. The full version of VISA should also be included on the CD you got with the GPIB board. Some of the GPIB CDs did not automatically install VISA but you can always stick the CD in and manually select it for installation.

  • INSTRUMENT I/O ASSISTANT EXPRESS VI - PERFECT PARSING NO OUTPUT

    I am using the Instrument I/O assistant express VI to parse data from a (visa) serial port. Neatest thing since sliced bread! I initially send a write command followed by eight read/parse commands to retrieve eight tokens each ending with cr/lf. All seems well during i/o setup. The Vi compiles and shows all eight string tokens. I then connect each one to a string indicator. When the Vi is run no data appears in the indicators. Repeated runs during the I/O setup shows tokens extracted perfectly. What's going on? 

    Hello oledaqman,
    I tried to replicate the problem you are seeing, but everything seems
    to work fine on my system.  One option I would propose would be to
    use NI-SPY to determine if the reads are actually being performed when
    you run the VI.  NI-SPY should allow you to determine if the VISA
    commands inside the Express VI are being executed, as well as
    determining whether they are receiving any data.
    This will help us to determine whether the problem lies in the actual
    transmission of the data, or the parsing of the data after it is
    received.
    Let us know what you find, or if you have any questions, and we will be happy to help.
    Jason S.
    Applications Engineer
    National Instruments

  • Instrument I/O Assistant Crash

    I am using Instrument I/O Assistant to read data from a scale through a Serial->USB conversion, using LV2012 SP1 (I've also tried this on LV2010 with the same results).
    I configure the baud rate, parity bits etc, and that seems to work fine.  
    I add the "Read and Parse" step or a "Query and Parse" step, and then try to run the Instrument I/O Assistant.  The Instrument I/O Assistant window closes.  It doesn't throw an error, or a warning or anything.  
    Needless to say, the vi where I use the I/O Assistant does not run either.
    Any thoughts as to why this is happening?
    Attachments:
    Scale.vi ‏39 KB

    Personally, I think not having the assistant is not such a bad thing. What happens when you use the simple serial example? What sort of converter are you using (ftdi, etc.)? What os and version of VISA?

  • GPIB vi created with Instrument I/O assistant not timing out

    I am new to Labview and I am trying to write a
    program to control a HiPot tester via GPIB. This HiPot tester is used
    on several other projects, so its GPIB address can vary. I want to use
    Labview to scan for this device on the bus and then configure it.
    I used the Instrument I/O Assistant to create a subVI that can query
    the device for its manufacturer and model information. In this VI I
    created some connectors that allow an outside program to input the bus
    and device number. These numbers are formatted into a string and then
    used to send commands to the GPIB device.
    If I use this vi and specify the correct bus and device IDs for the
    hipot tester, I get back the expected data. However if I send in the
    wrong device ID (or wrong bus), the program hangs.
    The Instrument I/O Assistant creates a timeout value of 2000 msec for
    the operations. The *RST and *IDN? commands are sent first and then the
    VI performs read operations to fill 128 bytes. So I figure that the
    longest this should take to timeout is 2000*130 msec = 4.3 minutes. But
    10 minutes later the VI is still running.
    Why does this operation not timeout if the device and bus IDs on GPIB are not correct?
    Brian Rose

    Hi Brian
    the first problem would appear to be that you send a reset command. But you only give the instrument
    100ms to reset/reboot before your query its identify. If you have the instrument manual check to see actual timing
    of bus etc.
    As a rule of thumb I wait 300ms - If you run  NI spy you will be able to see exactly when processes occur.
    Add a sequence frame between reset command and id command.Place a 
    wait icon in the frame with a control on the input time so that you can
    adjust time from front panel.
    Initially set time to 400msand see what NI spy reveals.
    Go for it
    chow xseadog
    Message Edited by xseadog on 09-10-2005 01:47 AM
    Attachments:
    wait.PNG ‏11 KB

  • Convert String from ASCII to ANSI

    Hi,
    a command line instruction via LabVIEW function "System Exec.vi" retrieves me a string in ASCII format. Is there a function to convert string from ASCII to ANSII format? I use LabVIEW 8.5 German Installation.
    Kind Regards
    Christian
    Test Engineering
    digades GmbH
    www.digades.com

    Hallo Christian,
    AFAIK there is no such in function in LabView...
    But you can:
    - use "Search and replace string" to search for ASCII chars and replace them by their corresponding ANSI char, do this in a loop for all chars to be replaced (acceptable speed for small strings...)
    - convert the string to an U8 array and use a lookup table to convert all bytes from ASCII to ANSI, convert back to string (may be faster for long strings...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Instrument I/O Assistant returning delayed/slow response?

    Hi there,
    I'm somewhat new to LabVIEW 7.1 - I'm trying to make a simple program that reads and parses data over a serial line then plots it.
    I created a small program which connects the output from the IIOA to waveform charts.  I've read that the waveform charts plot the data points when the data is received, but when running the program, the chart updates with a new data point at 1Hz, yet my data is being sent at ~10Hz.
    I opened the Front Panel for the IIOA and ran just that .vi, and still, the data updates very slowly.
    Can someone offer me some insight regarding this problem?
    Thank you,
    Stefan

    Hi Stefan,
    If you have opened the front panel for the Instrument I/O Assistant,
    and the data still updates slowly, then it is likely that your
    instrument is taking longer than you think to respond?  I would
    recommend that you run NI-SPY while you are performing your
    acquisition.  In NI-SPY, you can double click on any of the driver
    calls and see how long the command took to execute.  This will
    allow you to determine whether there is a long delay inbetween two
    commands, or if the read command is taking a long time to
    complete.  I suspect that you will see that the read command is
    waiting a while before it actually receives the data and is able to
    return.
    Let us know what you are able to find with NI-SPY, or if you have any more questions.
    Jason S.
    Applications Engineer
    National Instruments

Maybe you are looking for