Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Communication

Hi all,
 
I have a three problem with RS232 communication.
 
1. I do want to acquire 19 data as a single set where as now I'm getting only upto 15.
    Is that possible through RS232, or in any of other protocols available.
    Where should I do changes in LabView inorder to make these changes.
 
2. When data is aquired to the PC through RS232 connection as I told
    obtained 15 set of values, ie, one set of data now recieving is not recieved in an order.
    I know its something related with read bits in VISA READ.vi
    ie,  If starting character is ~, this character will come in between the displayed
    data set.
 
    I want in such a way that this starting character should be the first character shown
    in the data set displayed on the PC.
 
3. The command that i'll be sending to the machine is always displayed in the first line
    of the recieved data set everytime. How can i block this sended command being recieved in this
    recieved data set.
 
Waiting for a solution:::::Smiley Sad
Using LabVIEW 8.0, 8.0.1, 8.2
0 Kudos
Message 1 of 47
(7,447 Views)
Please anybody help me
 
Using LabVIEW 8.0, 8.0.1, 8.2
0 Kudos
Message 2 of 47
(7,418 Views)
You really have to provide a bit more information. First of all, what is the instrument you are trying to talk to. If no one has any experience with it, you have to provide the serial communication information from the vendor. A link will work but attaching the document would be better. Attaching an image or the actual code you've written would also help. I have no idea what you mean when you save you only get 15 items of data when you want 19. Does the instrument return 19 items at a time or are you trying to poll the instrument more often? Does the instrument constantly send out data or only when you send a request?
Message 3 of 47
(7,411 Views)

Hi Dennis,

Actually i have to communicate with a diameter guage which has 34 data parameters generated for each scan.

Out of which now i am able to acquire max of 15 data only.

In the output data recieved from the guage every datas are seperated by Line feed

and the first line will be the command which is send to the guage itself in every recieved scan data set.

Now my requirement is to acquire all the datas avilable if possible to any database in PC.

The guage sends all these set of datas continously at its scan rate and it doesnt depends upon the request send to the guage.

Whenever we sends a command the corresponding data is being send by the guage

This diameter guage has 600 scans per second

and have maximum baud rate of 38400.

Word index\address                                               Data

  • 1 ..........................................................NO VALUE
  • 2 ..........................................................SSFD FLAW
  • 3 ..........................................................SSFD LAST MAX FLAW VALUE
  • 4 ..........................................................CONTROLLER OUTPUT
  • 5 ..........................................................XY DATA
  • 6 ..........................................................ERROR VALUE
  • 7 ..........................................................X DIA VALUE
  • 8 ..........................................................Y DIA VALUE
  • 9 ..........................................................% X AXIS POSITION
  • 10.........................................................% Y AXIS POSITION
  • 11.........................................................LINE SPEED
  • 12.........................................................STD. DEVIATION
  • 13.........................................................MAX DIA VALUE
  • 14.........................................................MIN DIA VALUE
  • 15.........................................................Chi sqaure
  • 16.........................................................SPC UPDATE TIME
  • 17.........................................................FFT UPDATE TIME
  • 18.........................................................Cp
  • 19.........................................................Cpk
  • 20-35....................................................NO VALUE
  • 36-51....................................................GRAPH DATA

Now the command format is * 2 18

It means * is command character which determine whether it is read or write to guage,

2 is starting word index and 

18 means it should give concecutive 18 data parameters starting from 2,

ie, from SSFD  FLAW VALUE to Cpk.

But as of now its giving upto maximum of concecutive 15 parameters.

I think now its more clear, please HELP ME to solve out this.

Using LabVIEW 8.0, 8.0.1, 8.2
0 Kudos
Message 4 of 47
(7,387 Views)
maybe you can send the vi you use to get these data and we can look if somewhere characters are thrown away.
greetings from the Netherlands
Message 5 of 47
(7,379 Views)
Here is the vi i use
 
NB:   A subvi used is also attached
 
thanks
Using LabVIEW 8.0, 8.0.1, 8.2
Download All
0 Kudos
Message 6 of 47
(7,377 Views)
Hi

Are you sure you need to multiply by 6 to calculate the number of bytes returned.
Could you try with 8?

greetings from the Netherlands
Message 7 of 47
(7,373 Views)
i tried that by putting a control for that.
from that i saw that if i am going for a value above 6 the data acquisition speed becomes slow
Any alternate suggestion for that??
Smiley Sad
 
Using LabVIEW 8.0, 8.0.1, 8.2
0 Kudos
Message 8 of 47
(7,382 Views)
Hi
 
Now I've attached a screenshot of the data recieved from the guage.
From this raw data I want it writen to excel sheet with every set of data in each row
and each data parameter from a single data set to go to seperate column in a single row.
 
How can it be achieved ??
I dont know, I'm so much confused.
Smiley Sad
Using LabVIEW 8.0, 8.0.1, 8.2
0 Kudos
Message 9 of 47
(7,384 Views)

I wish I could view the VI but I only have 7.1. You seem to be making two contradictory statements with:

"The guage sends all these set of datas continously at its scan rate and it doesnt depends upon the request send to the guage.

Whenever we sends a command the corresponding data is being send by the guage"

Do you or don't you send a command to the instrument each time you want to read the data? Since you can't really use the termination character, in order to avoid problems with determining the number of bytes to read, use the VISA Bytes at Serial Port. Put it in a loop and exit when byte count is greater than zero. The put it ina another loop and keep reading until byte is zero. That way you know that the serial port buffer is empty. If it keeps sending data without you sending a command each time, you could use VISA Bytes at Serial Port in a loop to constantly read. Write the data to a queue or shift register so that it could be parsed separately by looking for the beginning of the data stream. A match pattern function could work.

Message 10 of 47
(7,370 Views)