10-21-2020 01:44 PM
Dear all,
I am new with Labview, hence, my apologies for any stupid questions.
I have a temperature controoler Ascon KX03 that can communicate trhough a serial port with Modbus protocol (I attached the datasheet, in particular at pag. 9 there is an example of the commands to get some information). As first step I connected the controller using a SerialTec software that works fine, so I am able to establish a communication and get, as instance, the current temperature value. I attach the screenshot with the string that SerialTec is sending to receive the temperature value. I would like to read using Labview, but I am trying without success. I attach my simple IV that is not giving any results. Actually, I don't know how to send a string of command (byte and words) to the controller. Sorry if it is a stupid question: how can I send the string of command to the controller to receive and answer and record the answer, please?
Thank you for your help
Solved! Go to Solution.
10-21-2020 02:43 PM
10-21-2020 03:18 PM
Hi Albert,
thank you very much for your quick answer. I see you are expert on this topic... I am using a software called SerialTEC
ftp://atftp.ascontecnologic.com/Serialtec/ST_101.zip
that has a good user interface and, once I set the right boundrate, parity etc with the address of the controller (1) and the command for reading (200), it gives me the answer from the controller.
I don't know if I understood well your words: should I write a string of words and send to the controller to have an answer?
Thanks
10-21-2020 04:33 PM
Hi
Indeed, you can use serial communication in VISA to send the same string as in serialtec, I found out you are using the linx (makerhub) software for your test.
Instead of that use VISA because that is in fact a layer to send bytes via all kind of communication protocols to a device. And one of them is serial, other are GPIB, TC/IP, USB etc.
The modbus you have is a serial one otherwise serialtec would not have worked.
It is important to setup VISA correctly (and install the driver if not already installed on your system).
One of the odd things compared to other serial libraries is that you have to ad a cr/lf if needed, but probably not in the modbus case.
hope to hear that it is working at least for the cmd you already know.
10-22-2020 06:57 AM
Hi Albert,
thank you very much again for your answer and big help.
I am trying using cmd, by sending the string 01 03 02 00 00 01 85 B2 (that I read from the SerialTEC software) but, unfortunately, I don't get yet any answer (below the commands that I used..). I will keep trying...
If you have any other ideas, please let me know.
In case you have time I also found an example of communication with the controller and Labview (attached) that should work for this controller and Modbus but actually I don't understand how it works and, so, I cannot adapt it in my case.
Thank you for your time..
10-22-2020 07:34 AM
Hi
A made an example and saw you are using LV14 so here it is.
In LabVIEW strings can be displayed in more formats.
I changed the display mode to hex, change this by clicking on the left token at the start of the string.
This is just displaying the characters send or received in a different style.
The content of the string is always the same.
Maybe I have swapped high and low bytes this way but I guess you can play with this.
10-22-2020 08:51 AM
You are simply a genius!
Thanks really a lot
10-22-2020 08:53 AM
Now, I can read and control the temperature. I am working on display setting and making easier the conversion hex-dec, but I can figure something out.
thanks a lot, again..
10-22-2020 11:53 AM
Hi
Conversion from hex to decimal is easy
As I said the string just displays the values.
If you convert the string to an array of U8 you have all the values of the characters.
So you can do all arithmetic with the array.
And LabVIEW has a lot array operations.
Attached a crazy vi that has some string to number manipulations