Simple query in Matlab

P

Thread Starter

Pavel

Hi! I am completely new to this stuff so please don't yell at me because of my stupid question.

I am trying to read a value from a pressure Controller (West, 6100+) connected to my Computer via r232 using an ascii query implemented in Matlab.

Whenever I send my request ('L01M?*') i get the correct answer, although there's also a timeout warning ('Warning : A Timeout occurred before the terminator was reached') The problem is that I need continuous readings of at least 2 per sec. With the Ascii implementation I only get one value every 2 seconds.

I read somewhere that with ascii communication it can take up to 1 sec for a message, so i guess i will have to do it in Modbus/RTU (supported by the controller) but I have no Idea how to even start.

Ok, I know, the principle is simple but how can I send a binary message to my slave? Maybe I am just blacking out, but since I found some (very expensive) commercial Java-libraries, I guess it is not that simple after all.

What bugs is that I only want to read out this one value over and over, so I do not have to bother about all the fancy gizmos this commercial products offer, I don't even have to calculate CRC values since they will be constant.

Can somebody give me a hint where to start looking at? I don't want anybody to do my job (sooner or later i will have to learn how to do it anyway ;-p)just a little hint would be cool.

Thanks in advance,

Pavel

P.S. Don't tell my boss I asked - he still thinks i am an expert on this sort of stuff ;-)
 
I've run into some of those stand alone PID controllers that can not handle fast (meaning multiple reads per second) via Modbus RTU comm, even though they can handle once per second updates.

Before you do a whole project, you might want to check with West and ask if the 6100 can handle 2 RTU queries per second.

Or if you get silence or a breezy answer, you could check the West's performance with one of the generic Modbus master apps like Modscan32 or Simply Modbus. I know Modscan32 has read rates configurable in units of milliseconds.

To an overview, your PC needs an app that is a Modbus master to talk to the West, which (you say) is Modbus slave.

The needs some Modbus master functionality to issue a request message to a given slave, identified by an slave ID number (usually 01 for a single device), to execute a read function y (usually 03 in your case), for data starting at register for this number of registers X, and concludes with a data integrity check called a CRC value.

The slave listens to the serial port and when it recognizes its slave ID number, it responds with a message that says, I'm #1, I'm executing function code y, here's Y number of bytes, the data from those registers is . . . . . . CRC.

The app receives the slave's response, interprets the data (it's ones and zeros) and deals with the data: saves it, displays it, reacts to it, whatever.

Wikipedia tells me that Matlab is a programming language. OK. Maybe Matlab talks out and/or listens to a serial port. If so, you could write an app to do this.

The Modbus specification is somewhere on the Modbus.org site and gives an flow chart outline of the various function codes.

Or, there might be some open source Windows master that will do this for you.

Modscan32 logs data to either a text file .csv file. Or it might do more, I only use it for testing com links. It is licensed software. Other forum participants might have suggestions for a simple master app.
 
Top