VISA from read/write to serial port - unable to implements several orders of writing!

Hello

I'm new to Labview and I'm reading from a pressure through a virtual serial port USB sensor. I am able to read the port when you use HyperTerminal

The code sequence that I should write to the port in order to obtain measurements using hyperterminal is the following:

' *' (2A hex)-online start and the responses of the port by asking 'Command', I should then enter

FF-online measurement select the port must ask the 'mode', so I should enter

0 has-online measurement of high resolution mode and it was then that I should start receiving action.

The port is always answer by errors when I write the start command or the FF one. I tried to establish a sequence stacked to write the three commands then read the port, I added some delay between the three of them, but it does not work.

Now I made really simple and removed the stacked sequence and just put the three commands one after the other and try to remedy not to not on the code.

I'm really stuck at this point, could someone help me please? I read a lot fo articles on the forum, but I can't solve this problem

Thank you

I have attached my VI and the SCP1000 documentation (I can provide other versions of my demo if necessary)

The reason for your problem is a frequent misunderstanding even among experienced programmers. Take a look at this thread

http://forums.NI.com/NI/board/message?board.ID=170&thread.ID=417750

In your data sheet, then they return codes like 0xFF or 0x0A so has a single byte of average value. Then you in your-active code constant writing FF\n is so this equal to values in format hexadecimal 46460A and your instrument do not understand. But it will include FF0A. In order to solve your problem, you would type in \FF\n in your '-' chain helped codes. Remember too, if you type in \32 it will be converted to character 2 this being 0 x 32 50 decimals and code ASCII 50 is equal 2

Take the time and change the display format of string between '-' display and Hex display and you will see the difference

Hope this helps

Tags: NI Software

Similar Questions

  • What functions can I use to read from a RS-422 serial port?

    I'm reading a continuous strem of three numbers of an anemometer connected via RS - 422. What is the easiest way to read these in LabVIEW? Also it would be easy to separate these numbers andplot them separately against the clock?

    Dear

    He's hit 422 network operations and Miss at best. We decided to use their equipment to convert RS232 RS422 but only use an intrument on each 422 network. So we didn't need mark of unity, we use a serial port, separate for each instrument. I just configured to run in default mode on several occasions where they send their status message. The default mode also transmits all three (if you use patterns 3-axis) for the playback speed.

    When operating in this mode and configuration, everything I have to do is surround data and analyze the updated.

    This screenshot should show you everything you need to get started.

    Have fun!

    Ben

  • Visa series read write

    Hello..

    I have no problem with reading series. I want to playback multiple visa series... Fist read I want to read the data of 5x8bit uC then if visa data read isnot "NOT" I'm going to send data to the CPU as the character ' end then read data from uC to new but is leght data 2x8bit data...

    Please, help me...

    This is the number of bytes you want to read. You already said you first want to read 5 bytes. If you use VISA set up the Serial Port and the stop character allow to true, you can set a number of high bytes and playback will end when the stop character is detected. The character of default endpoint is a line break. If you set it to false, you can use the bytes VISA to the Serial Port to determine the number of bytes in the buffer is and read this number. This makes the basic example.

    Did you do any debugging serial communication base? I suggest that you use a program like Hyperterminal/Procomm/Putty/.etc before trying to write your own program. It is also difficult to give detailed advice without knowing how you have set the serial communication of the microphone.

  • Problem: read bytes to serial port

    Hello, I need to communicate with an external device with serial port. I have to write a command to my device string, and then it should play with 64 bytes of data. I built a function of READING-WRITING and I use it in a loop (I have to read a lot of 64-byte block)

    Sometimes, I have the following problem:

    (1) I have send the command string, I wait with "Bytes to the serial port" whereas I have more then 60 bytes, then I read.

    (2) sometimes happen that the read function cannot read all 64 bytes, so the net for cycle, I have in the receiver buffer mor than 64 and the program to stop working. (does not work well)

    I need to be sure that after writing the command I have 64 bytes, so I red all the 64 bytes so the next loop for, I have the buffer of the empty receiver.

    I enclose my writing reading function. Please refer to the block diagram (there are a few notes).

    Thank you

    In no place in your program see the VISA configure the Serial Port. It's always a good idea to include this that even if you use the default settings. I suspect this is one of the default settings which is wrong with you. By default, playback is set to end when a character is considered. This means that if you have a 10 hex (ASCII LF) in your stream, playback stops until the specified number of bytes is read. Put in a VISA set up the Serial Port and connect a constant False to the stop character allow entry.

  • Reading codes ascii serial port and their trace

    Hello

    I am trying to build a VI that reads data (ascii values) of the serial port.

    I am trying to build a Phonocardiogram wireless. I have a microphone that acquires the heart sounds. These signals is amplified and sent to an A/D converter to digitize it. the digital signal are sent to a base unit. UNTV signals received by the base unit must be sent to a computer (via a serial port to display).

    I would like to build a VI to draw ascii data received through the serial port.

    I would like to draw these values so that the plot resembles an analog signal (the one I had before an A/D converter).

    Can someone give me help?

    Thanks in advance...

    HII

  • Add event to VISA N read/write

    Hi all

    I enclose the snapshot of VI I'm working.

    When the number of bytes to Port > = 1054, he reads from the port.

    I will now carry out playback VISA in a housing structure.

    Now, I want to run this function of reading in a node of the event. as every time that the bytes to port > = 1054, it should initiate an event and read function must be called in this node event rather than in a housing structure.

    How is that possible?

    Thank you

    Ritesh

    Just use the event of timeout and put inside your existing code.

  • Read/write port DAQmx questions

    Environment

    Windows XP SP3

    LabView 7.1

    NOR-DAQmx 8.7.1

    (2) PCI-DIO-96 cards

    I'm trying to move from the level of registry TDAQ programming DAQmx and give me an "intensive" in mx.  I'm not sure about a few things.

    I need to put in place 20 channels/tasks that will run a mix of single, large port (8-bit) bed and written.  Some will be handshaking (82 c 55 mode 1) and some no handshake (82 c 55 mode 0).

    The plan is to create all tasks during an initialization routine and save the names of global tasks.  I open the task after creation and use the globals during the main part of the program execution, when I make the reads/writes on the port.  The body can run for hours at a time.  When the main is closed, the stop routiine close all tasks to exit ahead.

    Regarding the task creation/destruction - is it safe to create tasks and leave them open, or should they be created and destroyed every time that a write is performed?

    Regarding the port reads/writes, I suppose that when a port single read/write is made, there is no established buffer.  Is this correct?  Specifically, if I use the method above and leave task open, is it possible saturation of buffer or something similar to happen?

    TIA

    Charlie

    Regret - Yes, you said 7.1 - I can't keep back away, but here is a screenshot

    And - the task is saved outside of LabVIEW, so it's not really 'Open' or 'Closed', even when programmatically, create and destroy jobs.  Tasks exist or do not exist.  If they exist and have no errors, they can be run.

    Tampons are to move data to and from the device.  For static DIO, this isn't a problem.  You CAN run into problems with a task of acquiring buttons if it acquires data as soon as you read the data, but you can work around this by starting and stopping the task properly.

  • error of node (arg 1) .vi property VISA set up a Serial Port (Instr)

    Hi all

    I have a request, he had run on a machine well for months.  I use VISA to make the communication between PC and PIC.

    Suddenly at certain times, it reports error of node (arg 1) VISA property set up a Serial Port (Instr) .vi. Since then, it does not work.

    Œuvres of HyperTerminal.  I check MAX, the COM port it and looks very good.  What is the problem?

    Furthermore, I use VISA 4.2.  Maybe somehow it crashed?

    Many thanks for any help.

    Problem solved.

    The reason is that the hard disk was running out of space and there is error.  Somehow, causing accident DURATION VISA.

    We cleaned drive C: for free space and then repaired DURATION VISA.  Now, he runs with happiness.

    Thank you, everyone, for your help.

  • whille prob get bytes to the serial port for serial communication

    Hi all

    I have one using the series write vi to send the command to the instrument. the answer I get is read NICU playback vi. I use between read and write the serial port bytes accumulate bytes. BU what I observed is quite strange. When I run the vi with the debugger, I could c the bytes to port series is 201 and what I get in buffer is only 133.

    any1 can guess at what the problem would be b?...

    You don't show the function of VISA set up a Serial Port, but I guess you have the active stop character. Playback will end automatically when the character is detected and you should never allow when you try to read hex.

  • Using the Serial Port for data acquisition Non-Serial

    I searched the forums and can't find anything on this topic.

    I saw that it was possible to use the parallel port for e/s digital single and I was hoping that the serial port can be configured the same. It seems all VI VISA only to use the serial port to receive ASCII characters at a given flow rate, but is it possible to simply query the status of the line series at my own speed to see if it is high or low, kind of like a single pin DAQ?

    It seems that it would be possible until the serial data are read and controlled by labview, not Windows. Let me know if you have ideas of how to approach this problem, or any comment as to why it is not possible.

    Thank you all!

    Select the property > settings series > Modem of the line parameters. For example, the State of the CTS is an entry to the pc.

    With the help of these lines is a very poor substitute for a scope or map DAQ. The only things you can return is Asserted, Unknown or Unasserted. The range of acceptable signals is important enough. Anything between + 3 and -3 is an unknown state. Your other signals is + / 3 to 15 volts. What type of signals do you really want to capture?

    Edit: there is no such thing as a visa so I have no idea of what you actually use.

  • Get integer values of visa series read

    Hello

    I am having trouble getting the integer values correct of the reading series string that I get. For example if I send 0P3 I get 48,112,51 as elements of an array. I used the string to byte array function to convert the string I've read on the serial port. The values are the ascii equivalents. How can I get 0, p, 3 in the back? I need that the program does a length check and crc going wrong because 0 is now considered to be 48.

    concerning

    Bastien.


  • Questions about serial port read and write at the same time

    Hi I create a user interface for the communication serial port, where there are essentially 2 front panels, where the user enters commands one and the other where the prints of UART is delivered. I thought initially using a state machine but the reading and writing may be independent sometimes and so I can't rely on States. I searched a bit on the forum and he left me even more confused. Help, please.

    (1) in a thread that sessions visa duplicated has been used for writing and reading at the same time, is it recommendable? How will this affect performance?

    (2) essentially when the vi is reading data are it must constantly view as well, however, someone said that it takes too much memory to use shift registers, so how do I go about this? If using a State in queue after the loop of reading it affects the playback loop and be sequential?

    In addition anyway is to move the cursor to the latest data from the indicator

    (3) for the control of the user input, assumes that the user has entered an order in the control and press ENTER, then writing visa is launched, but if it comes in another string and press enter then write must be called again... is - it possible? will detect the previous commands in the control of compensation?

    (4) according to my understand the expectation for the event do not monopolize resources and writing can go in parallel, am I right?

    Thank you. I have attached a very basic vi which took me to the point, but I want to make it more robust. Please help especially in the part of the user interface.

    su_a,

    (1) you can have only one session to a port. Several UART can handle full duplex so performance is not affected.  At flow rates of high data and large amounts of data, buffering and latencies of BONE can become a problem.

    (2) who told you that shift registers using too much memory? Shift registers are usually the best way to transfer data from one iteration to another. String concatenation inside a loop (registry to offset or not) causes the chain to develop and may require re-allocation of memory.  Your VI never clears the string so its cold length become very large.

    Generally, you do not have an active cursor on an indicator.  If you want to always display the most recently received characters and turn on the vertical scroll bar use a property node to keep scrolls to the bottom.  This can be annoying for users if they attempt to manually move the scroll bar and find that the program continues to move it back automatically.

    (3) if the user has changed the value in the chain of command, when he hits enter the modified value event fires.  Simply strike brace does not change the value and does not trigger the event.  Not control need to be erased, but the value that he has to change.  If you want to send the same command again, have a button send a command may be a better choice.

    (4) write is a case of the event.  It is not in parallel with anything.  The structure of the event do not monopolize resources.  The other loop will run while it waits.

    The event loop will not stop when you press the STOP button. Probably it wll take two command: change events of value after JUDGMENT before any loop stops.  Replace the Timeout event (which never expires) with a STOP: value change event and a real wire of this judgment to the Terminal endpoint.  Remove the local variable.  Make mechanical locking when released.

    Lynn

  • Visa read write on port series independently and at the same time!

    Hi all!

    I need to read and write data to and from a serial port (rs232) independently and simultaneously .

    I'm sorry that I can not put a picture of that, but it's very simple:

    I used "set up the serial port" and forwarded to two while loops, the resource reference.

    a loop is reading data and the other loop is writing data to the port.

    the problem is when the playback loop (function serial reading) waiting for data - it blocks the other loop to run (writing of the serial function is blocked).

    I searched the forum and find this visa open function has 'duplicate session' option - that's what I need?

    If true, can someone explain exactly how to wire and use it in the right direction?

    Thank you very much.

    Guy.

    OK, I found an example that solved my problem: a VI called   serialduplicatesessions.

    The file is associated.

    Here is the link for all cases: http://zone.ni.com/devzone/cda/epd/p/id/1727

  • Time GPS, Position, Velocity.vi - error-1073807360 reading was held at node (arg 1) .vi property VISA set up a Serial Port (Instr)

    We receive information such as the Latitude and Longitude of a receiver Garmin GPS18xLVC via a serial port on our PC using LabView 7.1.  Successfully, I connected the GPS on the serial port and tested with HyperTerminal.  I tried reading GPS time, Position, Velocity.vi several times and still receive the following error message: error 1073807360 has occurred to the property node (arg 1) visa configure a Serial Port (Instr) .vi.  I think it has something to with the configuration of the VISA series under vi.  Any suggestions would be greatly appreciated.

    Thank you

    I understood the question, that I had with the time reading the GPS, the Position, the Velocity.vi.  The vi. "do not open" port com automatically and so I had to modify the NMEA GPS Subvi reading to first open the port (VISA open command) and then continue with other operations.  Once I did this it started to work very well.  I don't understand why this feature has been left out because it won't work without it.  I tested the code with a receiver Garmin 18xlvc and it seems to work fine.

  • read data from a serial port

    Hello to everyone
    I use oracle forms 6i. I want to read data from a serial port. How can I do this?

    HII,

    You may search for any existing OCX or VBX component capable of doing this job.

    Better compliance
    Skyniazi

Maybe you are looking for

  • Keyword.URL + browse by name is broken in FF23

    My Mac Firefox is advising me that it wants to be upgrade to v23. But the keyword in FF23 Windows url string and I use mac and Pc, I need to work on both every time. Keyword.URL and browse by name for Google is how to use internet, it is not a featur

  • SMC is a hardware or software problem according to the warranty?

    Hello! Two months ago I bought a Mac book air (11 '') and now has problems. I give it to technical support and they tell me that they made a reset for SCM (System Management Controller). SMC is a software or hardware problem? According to the guarant

  • to download windows xp professional

    My Compaq Presario V2000 has deleted my Opreting system of Windows XP PROFESSIONAL and I want to reinstall it please send me a link to download win xp FRP. 32-bit

  • Equium p200 1IR - stuck on the Microsoft logo

    My laptop seems to be "stuck" on the logo of Miscosoft when initially loggin. It moves on the screen Toshiba showing options that lets you choose PF2 or PF12 to implement menus etc. It was left during the night and always do the same thing, trying to

  • Envy 15 video freezing, BSOD

    Been responsible for research forums, but it seems that I am quite alone on this one (which seems very strange). I have reinstalled my desire with an OEM of W7 Pro version, used all the drivers on the HP support siteand I suffer from random blocks wh