LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String Output

Hi Smercurio,

  I installed portmon and run it. But could not able to access the string output. It showing error 'portmon could not attach to serial 0 - device may be in use'.  I checked the help file and tried starting portmon before executing VI. Still I am getting te same error. 

 

Thanks

 

Senthil

0 Kudos
Message 41 of 59
(1,458 Views)

You need to start portmon before launching LabVIEW. When you launch portmon it automatically lists the COM ports (by reading the registry), and begins monitoring on the first one. Verify it's monitoring the correct port and change it if it's not.

 

If you cannot get portmon to work, then use the attached VI. It will save the data captured over the serial port to file without the messy business of carriage return/linefeeds. Just upload the 2 files it creates. You will need to zip them up since the forum doesn't accept .bin files.

 

I still want to see your VI.  Upload it - do not post a screenshot.

0 Kudos
Message 42 of 59
(1,442 Views)

Hi Smercurio,

 Sorry for the long wait. I was out of station. I herewith attached the VI. I have connected the instrument via serial multiplexer. It has 4 serial ports (A,B,C and D) and a  Master port. The VI first initializes the master post and activates it. Then Sub-VI's process the serial outputs of corresponding serial ports. Presently, the instrument output is connected to port 'B' and the subVI (RC1DATA) reads the string output from the instrument.

 

Thanks

 

Senthil

0 Kudos
Message 43 of 59
(1,409 Views)

Uploading the top-level VI does not automatiically upload the subVIs - these are separate files. Thus, the actual VI that does the reading is not included. I do not understand why you are using those old VIs. Internally, they are actually wrappers around VISA, so you should be using the VISA functions directly, as they provide error I/O. As it is, you have no way of knowing if an error occurred in any of your serial functions.

 

Your VI is a basic loop, yet you are initializing the COM ports with each iteration. This is a waste of time. Initialize the port once before the loop starts, and close it once it's done.

 

Did you try running Portmon before starting LabVIEW? Did you try the VI I sent you?

0 Kudos
Message 44 of 59
(1,400 Views)

Hi Smercurio,

  I have tried using your VI and it displays error code. I attached the file O/P (invidual.bin, fullstring.bin) for your reference. Also attached the screen shot of front panel.

I used portmon and if I select 'COM1' port for capturing, a pop-up window triggers displaying 'port mon could not attach to COM1, the device may be in use'.

 

Regards,

Senthil

 

Download All
0 Kudos
Message 45 of 59
(1,370 Views)

You are not being consistent. Your VI's front panel shows that you were using 7 data bits and even parity. At least that's what you had the default values set to for the VI. I can only assume they were set that way because that's the serial port communication. Yet, you did not set the controls on the front panel of my VI to match your serial port settings. Obviously, my VI will then generate an error because the VISA functions will not interpret the data correctly. I have no idea what your serial port settings are - the front panel controls on my VI were set to default values that are typical.

 

Regarding Portmon: I don't know why you're having so much trouble running this utility, unless something else is using the serial port. Do you have LabVIEW closed at the time you run it? I'm talking about the full application. Do you have any other terminal program running? Are you even able to launch Portmon and connect to your serial port if you start from a reboot WITH NO OTHER APPLICATIONS RUNNING?

0 Kudos
Message 46 of 59
(1,360 Views)

Hi Smercurio,

   I have changed the serial port settings according to my VI specifications. Still I observed same error code and strings of ASCII characters as displayed in my previous post.

 

As per your suggestion, I disabled all the running parallel programs and started first portmon. Then I executed your VI. Now it seems working! I attached the output of portmon program with this post. Have a look.

 

Thanks

 

Senthil

0 Kudos
Message 47 of 59
(1,353 Views)
The Portmon log does not show enough. All that I see is the result of a single read which captured 21 bytes, only 2 of which were not null. Did you leave the VI running for a while? Is there something special required to start receiving the data that you have been posting? Can you have Portmon running with your VI?
0 Kudos
Message 48 of 59
(1,351 Views)

Hi smercurio,

 I attached herewith the portmon output for my VI operating via multiplexer. 

 

Thanks

Senthil

0 Kudos
Message 49 of 59
(1,337 Views)

Hi Smercurio,

  I herewith uploading the sub-VI (RCDATA) which has been used for processing the string read out from serial port read.vi.

 

Regards,

Senthil

0 Kudos
Message 50 of 59
(1,332 Views)