Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial

Solved!
Go to solution

Working on communicating with a instrument via serial connection and I had some questions.

 

How do I input a DTR signal in labview?

 

We were able to read the DTR and got a reading of 1 (pic) but we are un-sure if that is telling us what we need.

 

 

-K
0 Kudos
Message 1 of 43
(4,068 Views)
Why would you want to manually read or write any of the handshake lines? Set the handshaking with the config function and let the UART do the rest.
0 Kudos
Message 2 of 43
(4,056 Views)

Can you elaborate on that? I don't know where to set the configs and I don't know what the UART is.

 

thanks

-K
0 Kudos
Message 3 of 43
(4,045 Views)

The config is the VISA Configure Serial Port that you have shown in the example that you have mangled in the image. Bad idea to modify shipping examples. It has an input for flow control - including DTR/DSR.

 

The UART is the piece of hardware in a computer that performs the actual serial communication.

 

You still have not explained your whole purpose of reading or writing DTR. Are you just making this up as you go along?

0 Kudos
Message 4 of 43
(4,040 Views)

Right now we are just trying to establish comunication with the insturment and are having trouble. I can not answer why we wanted to use DTR. I was asking that question for someone else here that should be in later today. Ill let you know then. but for now, any suggestions as to get communication with the instrument would be great.

 

what we did with a different instrument that we had string commands for was just use one of the pre-made examples and just used the commands we had. Now we are trying to communicate with a machine that the commands are in C, we believe. We are unsure as to how to convert them to a string that Labview will understand.

-K
0 Kudos
Message 5 of 43
(4,033 Views)

My first thought is to make sure the baud rate is correct.  As far as commands go, can you post some of the C code so we can see what the protocol looks like?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 43
(4,029 Views)

Is this the same instrument you tried to use GPIB with or something different? The actual instrument is vital information that you need to provide. If it is different, you also need to attach the manual or proovide a link.

 

The machine does not have commands that are in C. You might have an example that uses C to talk to it but that is a completely different thing.

0 Kudos
Message 7 of 43
(4,026 Views)

like I said before, I don't know any programing language to speak of, so I don't know if this is even part of the commands or anything but here is a small part of what we have:

Struct example

    {BYTE sync_code1;

     BYTE sync_code2;

     BYTE pack_size;

     BYTE command_code;

     int device_number;

     int error_code;

     int home_sensor;

     int position_sensor;

     unsigned int checksum;

    } ;

 

 

and yes, baud rate, Parity, data bits, and stop bits are all correct.

-K
0 Kudos
Message 8 of 43
(4,023 Views)

It is a new machine, but it is a custome machine so there isn't anything online about it, and the manual is about 1600 pages.

-K
0 Kudos
Message 9 of 43
(4,022 Views)

and I am in the process of scanning the programing parts now, it will take a little bit though.

-K
0 Kudos
Message 10 of 43
(4,020 Views)