To send multiple operation commands to serial port

My AC power source is able to communicate to PC via serial port using LABView and I can perform any operation by giving commands in Hex individually, But when it comes to the parallel operation of all the commands or to put them in a particular sequence. I am failing to do so.

You can only send 1 command at a time.  That is just bus communications 101.  But you can string together many VISA Writes to send the individual commands, one after the other.
But since if sounds like you are doing this on a GUI based instance, what you want to do is configure the port before your loop and close the port after the loop.  Then inside your loop you just have an Event Structure to key off of the different controls changing values.  You just send the command you need to inside of each event case.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Similar Messages

  • Want to use dotNet with teststand, but unsure how to send commands through serial port

    I have a loCom communication dll used to send and recieve commands through serial comunication for a particular product.  I the past they have used a LabVIEW wrapper to send and recieve commands, using this particular dll.  I would like to just use testStand for the DOTNET Dll.  I can get the commands, know the inputs and outputs required, however I can not figure out how to send the commands to the serial port.  Anyone have any exprience doing this in TesSTand?

    hallawt,
    With your .NET code module, you should be able to call it directly, most likely as a parameter in the .NET method.
    What are the inputs for the method you're trying to use?
    Also, could you clarify where you're starting to have problems in your project?
    Regards,
    Renée M
    Applications Engineer
    National Instruments

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

  • Send DAQ measurement results through serial ports

    Hi, All
    I use PCI-6034E for measurement. After DAQ gets data, I send them to another computer through serial port (com1). I write a Virtual C++ program, which calls NI-DAQ library functions to implement DAQ data sampling (multiple channel scan) and sends measurement data to another computer through serial port under request. DAQ data sampling and serial communication are implemented in two threads. They are running concurrently. They share a global memory for measurement data. The serial communication thread will do infinite wait and send data only when another computer sends a request through serial port.
    I met two problems. First, when I reduce the size of DAQ measurement buffers (piBuffer and halfpiBuffer, I us
    edouble buffer model), DAQ measurement is often interrupted by the message "[DAQ_DB_HalfReady] returned NI-DAQ warning 10846. Your application was unable to retrive data from the background acquisition buffer fast enough so the unretrieved data was overwritten with new data. ...". I want to get run time data so I need to reduce the buffers as small as possible. How can I solve it ? The second problem is that the serial port gets error data (nothing) from measurement computer sometimes, especially when DAQ initializes itself and finishes work. It looks like that there is a conflict between DAQ and serial port. Does anyone have similar experience about this? Any suggestion?
    Thank you in advance.
    Le Cai

    Le Cai,
    You are correct that the number of scans to read is equal to half of the buffer in double buffer mode. I was mistaken and referring to a standard (non double buffered) operation. However, you can increase the size of your buffer without affecting the period of your acquisition. A buffer of 60 is quite small and, as such, will be more prone to overflow errors. The rate is actually set through the DAQ_Rate() and DAQ_Start() functions. For more information on these functions and how to configure the scan rate, please see the NI-DAQ Function Reference Manual.
    NI-DAQ Function Reference Manual for PC Compatibles
    http://digital.ni.com/manuals.nsf/websearch/1630A0B68738B269862567C1007A2912?OpenDocument&node=132100_US
    A good place to start would be the example titled, "DAQdoubleBuf.c" which ships with the NI-DAQ driver. If you installed the examples for Visual C++ when you installed the NI-DAQ driver you should be able to find this example in the \Program Files\National Instruments\NI-DAQ\Examples\VisualC\AI folder on your computer. This example would be a good template as it is very close to what you are trying to do.
    If you observe that you only receive the overflow error when you are operating the two threads, thus ruling out the buffer size as being a potential problem, you may want to examine whether or not your second thread is placing a lengthy exclusion on your data buffer during the period when your first thread is trying to move the data. If your first thread has to wait during the half-buffer transfer this could easily cause the overflow, as the acquisition would be running but the transfer would be paused. Instead of placing a mutual exclusion around one piece of global memory you could try using a queue instead. A queue approach will allow you to pass the data from the first thread into a queue to be read, when convenient, by the second thread. In this method the first thread would never have to wait as the transfer would just be a handoff.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • Esc Command to serial Port

    I'd like to send an esc command to the serial port in my LV-application. how I can do that ??
    I tried to use write to serial port and \1b as string but it not worked.
    In a terminal programm it works with the ESC key and with ALT+027.

    Hi,
    You have to be careful with the kind of datas that you send...
    You told that you sent \1b or something like this, but did you sent this in Ascii mode or \ mode... It's very different for the device...
    Maybe you have to write as a constant in \ mode the code \1b, and after that convert this string type to ascii mode using the roght button on the constant and then send the character to the device

  • Multiple operation using the same port does not work

    I am trying to have multiple operations on both ports
    here is my wsdl snapshot
         <portType name="CommonAlerter">
              <operation name="initiate">
                   <input message="client:CommonAlerterRequestInitMessage"/>
              </operation>
              <operation name="StartWait">
                   <input message="client:CommonAlerterRequestInitMessage2"/>
              </operation>
              <operation name="StopWait">
                   <input message="client:CommonAlerterRequestInitMessage3"/>
              </operation>
         </portType>
         <portType name="CommonAlerterCallback">
              <operation name="onResult">
                   <input message="client:CommonAlerterResponseMessage"/>
              </operation>
         </portType>
    I just added two new methods "StartWait" and "StopWait" to the default async. template that got generated when I created a new BPEL Project "CommonAlerter"
    Now I call this BPEL process from another BPEL project
    The three methods I call "initiate", "StartWait" and finally "StopWait" are at different stages in my calling BPEL processes. Although "initiate" gets called first.
    When I debug the calling process instance I get an error on the call to "StopWait" which gets called after "StartWait".
    Here is the error message
    Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-08010
    Failed get operation definition.
    Failed to get the WSDL operation definition of "StopWait" in portType "{http://xmlns.oracle.com/CommonAlerter}CommonAlerter".
    Please verify that operation "StopWait" is defined in portType "{http://xmlns.oracle.com/CommonAlerter}CommonAlerter".
    Now I do have this method in my WSDL
    Can some one help.
    My Message part XSD is
         <element name="CommonAlerterProcessInitRequest">
              <complexType>
                   <sequence>
                        <element name="initializeparam" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessRequest2">
              <complexType>
                   <sequence>
                        <element name="waittime" type="duration"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessRequest3">
              <complexType>
                   <sequence>
                        <element name="stopargument1" type="string"/>
    <element name="stopargument2" type="string"/>
                   </sequence>
              </complexType>
         </element>

    Here are the steps for multi operation synchronous BPEL process :
    1.     Create a new BPEL process and delete request and response activities.
    2.     Now add the porttype/operation in the BPEL process wsdl.
    3.     Start the Process with a Pick activity and click on Create Instance checkbox. Remove the onAlarm branch as we do not need this. In the onMessage branch specify the name of the operation.
    4. Now add onMessage branches to match the number of operations. The flow for each onMessage branch is different. Just make sure that you create a reply activity at the end with the correct operation chosen. So you might end up having multiple return activities.
    Sometimes, a wsdl with multiple operations might not work as expected if the process version is 1.0. So try changing the process version in case you are not getting the expected results.
    Hitesh

  • How to set the number of packets to be send per second to the serial port in labview

    hi.
                  i have to send data to serial port such that each packet of data should be send at a rate of 4 packets per second?? how can it be done??
    thanks and regards
    Solved!
    Go to Solution.

    What defines a packet?
    You just need to have a while loop that has a wait timer in it of 250 milliseconds surrounding your VISA write function.

  • Send to the request by serial port

    HELP !!!
    Bonjour... et merci de bien vouloir me dépanner ...
    J'ai une application où un automate programmable (TSX57 de Schneider El.) doit communiquer avec un PC par une liaison série RS-232 pour échanger des informations.
    Du côté du PC, j'ai Labview 6.1 comme outil de développement avec IMAQ Vision Builder.
    Je désire que l'automate donne un signal au PC (par le port série), pour que ce dernier exécute un Vi, préalablement généré par IMAQ Vision Builder, qui émettra des informations via l'automate.
    Avez-vous un exemple en Labview ou des explications claires qui me permette d'émettre des caractères "à la demande" du récepteur ???

    Vous devez m'excuser parce-que je ne peux pas essayer une reponse en Francais, mais...
    You will need a loop running in which you read one or more characters from the serial port (using a suitable timeout) and maybe accumulate them in a shift register until you determine that a valid message has been received (or your program has to exit). Then you either carry out your processing or discard the message if it is invalid. I'm sure that looking at the VISA examples will help you work out how to do this. The VISA termination character property can be very useful if your messages are always terminated with a known character such as a CR.

  • Send a single command to LTP Port

    Hello,
    I am still some what new to java. I have been looking and looking for a way to simply send the hex code 07 to my LPT port. When reading the documents provided by with the printer there is a simple way to it in doss. type "echo (press control+G) > LTP1".
    Is there any way i can do the same thing but through java.

    You can use the methods of ProcessBuilder (preferably) or Runtime classes to execute a command like that in Windows' cmd window. Make sure that the command works from the cmd window, first. Read about how to use the methods of these 2 classes in the Java API documentation. It can be read or downloaded from Sun's JDK download page.
    Or, youu could install the RXTX package and use that.

  • Cannot Send Ctrl+B command over serial Com2

    I am trying to communicate with a serial instrument. The ascii command is "STX" however with labview when
    the command is sent there is no response. Using Hyperterminal with the same configuration(as labview) I can press "ctrl+b" and instrumnet responds. what is different?

    I think what you need to do is send the byte value for STX which I think is 02 hex. There are a few ways to do this. The easiest way to do so is to right click on a text control and select hex display. Now type 02. Change it back to normal display if you want to type in the rest of your message. Connect this control to serial/VISA write. This should be the same as type "ctrl+b" in HyperTerminal.
    Let me know if this doesn't help you.
    Brian

  • Need a gui to send simple ascii commands to com port

    I am not a programmer. Several years ago I took a class in Java. Now, I am looking for a gui with buttons that are programmed so that when clicked on with mouse a command (ascii or hex) will be sent to the com port. I am pretty sure that I don't want to read from the port. I have a table of commands that I want to match up to some buttons - a simple way of putting it.

    Before you embark on Swing and javax.comm, I'd encourage you to get up to speed with basic Java. A lot has changed in the past couple of years, and getting some practice with the basics will save you a great deal of frustration. Here are some recommended resources:
    Installation Notes - JDK 5.0 Microsoft Windows (32-bit)
    Your First Cup of Java
    The Java� Tutorial - A practical guide for programmers
    The Java� Tutorial - Trail: Learning the Java Language
    New to Java Center
    Java Programming Notes - Fred Swartz
    How To Think Like A Computer Scientist
    Introduction to Computer Science using Java
    The Java Developers Almanac 1.4
    Object-Oriented Programming Concepts
    Object-oriented language basics
    Don't Fear the OOP
    Books:
    The Java Programming Language - 4th Edition
    Head First Java, by Bert Bates and Kathy Sierra
    Thinking in Java (Free online), by Bruce Eckel
    Core Java, by Cay Horstmann and Gary Cornell
    Effective Java, by Joshua Bloch
    Let us know if you have specific questions. Good luck!

  • Could Someone send me a 'VISA Configure Serial Port.vi'???

    I need that VI from LabVIEW version 6.1! My mail is [email protected]
    Thank You.

    I made a vi that does the same and can serve for you as an example. look in the help how to use it.
    part of it is 6.0 and part 6.1 but that is no problem.
    The 6.0 vi's will be converted when loaded
    greetings from the Netherlands
    Attachments:
    visaoptions.zip ‏69 KB

  • How to send a command in Hex to serial port

    I need to send the following command to serial port
    [SS] [1] [CR] to serial port , how do i do that in Hex

    Norman,
    Learn to write a single commands and get back a valid replies first, before
    you try to develop an app to continuously communicate with the instrument.
    Once you get the command set down, you can plug them into your state
    machine.
    Attached is a VI about ASCII to HEX and Carriage Returns.
    Parks
    "Noman" wrote in message
    news:[email protected]..
    > I need to send the following command to serial port
    > [SS] [1] [CR] to serial port , how do i do that in Hex
    [Attachment SS1 to Serial Port.vi, see below]
    Attachments:
    SS1_to_Serial_Port.vi ‏30 KB

  • Join two 8 bit integers and send via Serial Port

    I am trying to join two 8 bit integers and send the result via the serial port.
    I have a constant of hex value A that I need to join with a value from hex 0 - F (this is based on incoming data)
    When I use the Join VI, and type cast to change from hex to string for Visa Write, I recieve hex 0A0F.
    I have been able to use the hex 0-F with a case structure and then wire the corresponding constant ex A0 - AF.
    This makes the program very cumbersome and labour intensive to change. I have 22 commands I have to respond to with the address of 0-F.
    Currently, I have a Case structure that is selected with Message ID, then a case that is selected with subtype and then a case for address.
    Therefore I have to create a constant inside of each address case for each message as the responses are different.
    Thanks for any help
    Robin

    Gambin,
    As I understand it, you want to take the two bytes, put them together,
    and output the result as an ASCII string on the serial port.  This
    is easy.  Simply convert each number to an ASCII string,
    concatonate the two characters together, and send the resulting string
    to the VISA write function.  That's it!  I have attached a VI
    (ver. 7.1) that takes two hex numbers as input, converts them to ASCII,
    concatonates the results, and outputs the 'command' string.  Fell
    free to modify this vi and use it as you see fit.  I have left
    extra terminals in case you want to add error input/output for data
    flow, or whatever.  Notice that the display for the concatonated
    string is in '/' Codes Display mode.  This is because 0A hex is
    the newline character in ASCII.  You should also check to make
    sure that your VISA serial settings are not setup so that the newline
    character is the termination character.  If it is, the second
    character may not be recognised.  Hope this helps.
    Roy
    Attachments:
    HextoCommand.vi ‏17 KB

  • Sending Hex text files to the Serial Port

    Hi,
    Does anyone know or have any experience in how to open a Hex file, read
    the data and send it down the serial port.
    Regards,
    Martin.

    Martin Stanley wrote:
    >
    > Hi,
    > Does anyone know or have any experience in how to open a Hex file, read
    > the data and send it down the serial port.
    >
    > Regards,
    > Martin.
    Martin,
    I have a vi that reads a hex file then sends the data out the serial port.
    It waits for each byte to be echoed back before sending the next one.
    As each hex number is read, it's converted to a decimal number. The number
    is used as a decimal ascii code, the ascii character is then sent to the
    serial port.
    I'm not sure if this is the most efficient way to do it, but it works.
    Walter

Maybe you are looking for

  • Wifi slow - Fixed in Safe Mode though, what to do now?

    Hey everyone! I have a new Macbook Pro Retina and the WiFi is acting super slow sometimes. The connection is stable and it also connects instantly. But sometimes it takes a while for the pages to actually load to the point where content is being show

  • HP5510 All-In-One won't scan entire page image

    Is there a setting or something that I'm missing when it comes to scanning with my 5510 All-In-One? I'm scanning to my MacBook using OS X.  And yes,  I'm placing my document in the appropriate corner, but I'm only getting a small portion of the 8 1/2

  • IDOC to File Senario - Mapin error

    Hi,    I am trying IDOC to File Senario using XI. I am stuck while message mapping. I need to map IDOC : MATMAS.MATMAS01 (Material numbaer and Matrial description ) to File. I have imported IDOC : MATMAS.MATMAS01 in IR. Created target Data type/ mess

  • HT4461 Can I transfer my iphone aps to my new iMac?

    Can I transfer my iphone purchased apps to my new iMac?

  • SOAP HTTP header in SOAP request

    Hi, How to add the soap HTTP additional header in the SOAP request? I want to add the headers not through coding. I want to add it manually. I can able to add the HTTP headers through SOAPUI. But i need to add the same inside the request. Could someo