06-04-2012 05:27 PM
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.
Solved! Go to Solution.
06-04-2012 08:44 PM
06-05-2012 10:08 AM
Can you elaborate on that? I don't know where to set the configs and I don't know what the UART is.
thanks
06-05-2012 10:15 AM
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?
06-05-2012 10:23 AM
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.
06-05-2012 10:29 AM
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?
06-05-2012 10:34 AM
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.
06-05-2012 10:39 AM
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.
06-05-2012 10:40 AM
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.
06-05-2012 10:41 AM
and I am in the process of scanning the programing parts now, it will take a little bit though.