Serial Value Fetching

The following topic had some examples as well…
Need A Simple Serial Terminal

[quote=169167:@Michel Bujardet]I am not trying to do it for you. You have to study what the device returns, what are the commands to send like that one for the device to work, and build your app based on that.

You may want to start by writing down all the commands needed by your future application, the possible responses from the device including errors, and this will give you a more complete picture as what you need to do.[/quote]

Sir, I am not used to this coding language. I learned C# in the fourth grade to do my homework for me, but haven’t used it since. I apologize that I am having difficulty. Serial communication seems like one of the more difficult things to do and I wanted help. I have been reading and studying, but there are not many sources for xojo other than this one. I am sorry I invaded your forum.

[quote=169257:@LangueR]The following topic had some examples as well…
Need A Simple Serial Terminal[/quote]

This is helpful. Thank you.

It is not a question of coding language. Serial communication with devices is a rigorous and sometimes difficult field. Pass the generalities about terminal, it is impossible to assist without a minimum of informations about the device you intent to pilot.

An example of what is necessary is the manual for a pressure transducer here : http://validyne.com/InstructionDownload.aspx?FileNM=InstructionCatalog/94.pdf

It lists all instructions and the responses one can expect from the device.

How do you want any help when you did not even share the make of the transducer you experiment with, or its model ? It is just like if you said about a car “it has an ignition key” and nothing else.

The problem is not the computer language.

Added Modbus to Julen’s ComCheck code above.

ComCheck Modbus Edition :slight_smile:

Tested the quick and dirty code with a Carlo Gavazzi Em24 Energy meter.
EM24

You also should take a look at this page:
Read Modbus Holding Registers

Let me know if you get stuck.

Kato

Alright, I have been putting off this part of my project for a while as the other components needed to be built and were not as much of a struggle. This also gave me additional time to learn more about Xojo.

I have found everything I needed with Cool Term and the settings are the following:

Baudrate = 115200
Data bits = 8
Stop Bits = 1
Parity = None
Flow Control:
CTS = Off
DTR = Off
XON = Off
Initial Status:
DTR = Off
RTS = Off

The ASCII code to connect with the serial port to return the information I am looking for is “!001:SYS?”.

This returns a positive or negative numerical reading which I want to return as a integer.

If I could get assistance in how to do this, I would really appreciate it! Thank you so much.

i think you want

= endofline.unix

dim s as string = “!001:SYS?” + endofline.unix

serial.write s

[quote=172591:@Russ Lunn]i think you want

= endofline.unix

dim s as string = “!001:SYS?” + endofline.unix

serial.write s[/quote]

So to get me started at writing this communication, my objective is to make the value given from the serial port a variable that can be accessed by many parts of the program. Because this is my first time doing serial port programming, I really need to be taught this. Thank you so much ahead of time.

[quote=168841:@Kato Gangstad]I have code for communication with modbus devices if you’re interested…
Send me a personal message.

Kato[/quote]

I submitted a post last year on modbus. I was trying to use ActiveX for modbus communication over TCP/IP but couldn’t get it to work. I don’t want to use serial port for this project. I am wondering if your code for serial port can be modified for this purpose.

Please assist.

Sure, no problem. Modbus tcpip is basically the same as modbus rtu.