cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Signal processing how to transfere information using MOSBUS format

gcevallos
6-Contributor

Signal processing how to transfere information using MOSBUS format

MAthlab has the ability too has MODBUS port

MATHCAD has this ability?

‌Signal processing how to transfere information using MOSBUS format

12 REPLIES 12
RichardJ
19-Tanzanite
(To:gcevallos)

As Luc says here: In signal processing haw to read in line analog instruments 4 to 20 mA, Mathcad is not suited to this task, or any task that requires real time monitoring of data streams. It's just the wrong tool for the job.

gcevallos
6-Contributor
(To:RichardJ)

‌we are thinking use a special electronics cards

those cards maybe have a disk where we could read the data

RichardJ
19-Tanzanite
(To:gcevallos)

The problem is not the availability of a data acquisition card. Mathcad 15 supports user defined DLLs, so it's certainly possible to write an interface that would allow Mathcad to read from a data acquisition card. The problem is that Mathcad is simply the wrong tool to do that in a continuous manner (which, since you are asking about 4-20 mA and Modbus, is what I assume you want to do). Let's suppose you had such a DLL that defines a function that reads from the card. You call it, it reads the latest value, displays in on a graph, and then the worksheet stops. OK, so you put a loop in the DLL so that it continues to read. Then Mathcad calls the DLL, the DLL never exits, and Mathcad is hung. OK, so what about putting the function in a Mathcad loop? Basically, the same problem. In either case you could set the loop to run for a set umber of iterations (or time), but you would not see any of the values until the end, when you see them all, and then the worksheet stops. There's not a lot of point in a process monitoring system where you don't see anything until the process has ended (assuming it is even a batch process that actually does end). As far as a process control system goes, it's obviously a complete non-starter. There is simply no way to make Mathcad continuously collect data and do other calculations or display that data at the same time. It's not what Mathcad does.

If you really need Mathcad for some reason the only option you would have to to write an external program that reads from the card and calls Mathcad via the automation interface to do calculations and get the results back. That's going to be kind of slow though.

If real time process monitoring or control is not what you want to do, please clarify what you do want to do.

If real time process monitoring or control is what you want to do, please specify why you think you need Mathcad to be a part of that. There still won't be any good solution using Mathcad, but maybe someone can suggest an alternative approach.

Hi.

For a model about the procedure to follow Richard suggestion, please check: Customer Presentation: Using Mathcad to Get Organized For Data Management as an example. The presentation is avaible at: Data Management for MathCAD . You need also to check the scilab software and the sourceforge program for capture it.

The MC11 Developer reference for DAC says:

Basic Operation

The basic operation of the DAC is as follows. You specify the particular operation to be performed and the channels that it will be performed on. The channels are specified using the ChannelString property. When the ChannelString property is set, a Channel object is created for each channel specified. Interaction with the outside world is accomplished through the Data member of each Channel object.

When acquiring data the SOC should automatically recalculate whenever any of its output values change. The embedded control also raises the DataAcquired or DataSent events upon completion of data transfer. These events can be used for event handler routines within the SOC.

When sending data the SOC should pass an input value to the Data member of a Channel object and the Send method should be called in the Exec routine of the SOC. If you don't want to send data automatically when the SOC is recalculated leave the Send method out of the Exec routine and manually click the Send button on the UI.

So, via scripting you can receive and send automatically data, given that you can program that by events, not only sequentially.

For practical implementation of this you have two choice: mathcad by itself, remembering that you can have open several instances of mathcad at the same time, for instance, at least two. The second is using mathcad as an OLE server, and making your ouwn vb project. See the examples under qsheet/samples/vbasic for that.

Best regards.

Alvaro.

gcevallos
6-Contributor
(To:RichardJ)

‌we already get on line data to mathcad using a PLCs together a HMI Intouch and excel as a bridge

tthe advantage is mathcad could made a complex calculation as a gas flow calculation from temperature,pressure and differential pressure real time data fron analog instruments

RichardJ
19-Tanzanite
(To:gcevallos)

So InTouch gets the data from the PLC, and pushes it to Mathcad via Excel? You could eliminate Excel from that, and have InTouch push the data directly to Mathcad. If that's what you are doing why do you want Mathcad to read the MODBUS or 4-20mA? Why not read the MODBUS or 4-20mA from InTouch?

You can use Mathcad to process the data, but you can't use it as the top level control software. However, it seems that's not what you want, because you are using InTouch for that. I'm still a little confused.

gcevallos
6-Contributor
(To:RichardJ)

‌yes, Intouch naturally take data from instruments and has MODBUS as serial comunication with PLCs, then a process those data in mathcad using excel as a bridge, then get back the calculation from mathcad to Intouch.

so the situation (Instruments,PLC,INTOUCH, Mathcad ) is solved

all in real time

aactually I am trying to read information from (analog,digital and image cameras) electronics cards, all because the calculations and mathematics are more easy in mathcad than math lab

RichardJ
19-Tanzanite
(To:gcevallos)

Then what you need to do is read the cards from within Intouch. Although it might be possible to write either a script or a user DLL in Mathcad that would read the cards, it would be no more difficult to do so in Intouch, and that would be a lot more efficient.

You could get rid of Excel as a bridge and have Intouch communicate directly with Mathcad. If the arrangement you have works there's probably not a lot of point in doing so though.

gustavo cevallos wrote:

yes, Intouch naturally take data from instruments and has MODBUS as serial comunication with PLCs, then a process those data in mathcad using excel as a bridge, then get back the calculation from mathcad to Intouch.

If I understand well, you can catch the data in real time in excel. If that, you can use mathcad inserting the worksheet as an object in excel, taking data from it, process the data in mathcad, and outputting the mathcad processed data into excel, in the same excel file where the mathcad object it is. Then that processed data can be send back to intouch from excel.

There are two examples of that,  Thermocouple.xls and Traject.xls in the folder \Mathcad 15\Resource Center\EN\qsheet\samples\excel\ .

An more general implementation of mathcad automation as excel object can be found here: Excel Addin

Best regards.

Alvaro

gcevallos
6-Contributor
(To:AlvaroDíaz)

‌No, Intouch which is HMI (human machine interface) work together a PLCs and instruments to collect data in real time.

then Intouch and Exel share a data

mathcad also sheer a data with Exel, so this is the way hwo we have a data at mathcad

in mathcad is more easy proccess the data and then get back the results in the same way to Intoch or PLCS

thouse hardware and software are expensive

tthe idea is replace the PLCs and Intouch with somethings more cheaper like electronics input/output cards because it have potential application to connect the real world with the mathematics world especially in robotic applications

the combination read electronics input/output cards, read camara images , and easy mathematics with mathcad is very attractive to achieve ameising goals

RichardJ
19-Tanzanite
(To:gcevallos)

I see. As I said, if you are only using it as a bridge you could get rid of Excel and go directly from Intouch to Mathcad. That obviously does not solve you problem of getting rid of (or replacing) Intouch though. Mathcad is not the right software to be the top level controller though. Have you considered LabView? That could read the cards (it has native support for many) and communicate directly with Mathcad.

gcevallos
6-Contributor
(To:RichardJ)

‌sound good we will try this way. It look more natural and more cheep

then we let you know a result

tthank for your gide

Top Tags