i have to communicate with Keller X33 using Labview. I have converter RS 485 - USB. i plan to monitrore pressure and temperature. I write simple program but byte count is not counted and data are not loaded.
Has anyone an idea what could i do wrong? And what about this function " write buffer"- what i have to write there. I am new in Labview programming and if someone woulg give me some tips i would be grateful 🙂
Your LabVIEW does need some tweaks but is in the general ballpark. What you really need is to RTM to answer the non-LabVIEW details about what to send (Write Buffer) and how to interperate the response and what hardware is needed to support the physiacl layer. All those answers are here. We can help you make sense of the concepts you are not familliar with but, you need to read the manual before you can even ask meaningful questions that do not require us to reply with a manual on how RS-485 communications are implmented.
Have you tried communicating with this device using MAX? With MAX, you can "experiment" with the Protocol, sending a command sequence and seeing what the device transmits back (if anything). Note you can also play with the port settings such as parity, baud rate, number of bits, flow control, etc.
The problem is you are using "Bytes at Port" which is the wrong thing to use about 99% of the time.
Let's look at what your VI does.
1. Writes out a command to the serial device. We'll assume for the moment you sent a valid command according to the manual.
2. You immediately after that check to see how many bytes have arrived back at the port. It is probably zero.
3. Then your program tries to read back zero bytes which means it reads nothing.
4. The serial device probably takes a small amount of time to get the message, process it, and send back data. But you've already checked how many bytes have arrived and it was zero.
"Write buffer" is not a function, it is a control that contains the command you send to your serial device. The correct commands to be sent should be found in the manual. Normally, you just define the commands in your program as a string constant rather than a string contorl.
also you can take a look here:
The company provides sample code for use also with LabVIEW.
I would definitelly recommend to practice LabVIEW first, with something easier. Also you can take a look here (if you are just starting with LabVIEW):