Forcing and scaling

J

Thread Starter

Johan Bengtsson

Different types of I/O modules have different scaling for the same thing.

Some modules I have used are scaled 800-4000 for a 4-20mA signal, other are scaled 400-2000, yet other are scaled 0-65535 and so on

I would like to be able to handle this in the I/O driver to be able to change from one type of module to another without affecting the rest more than necesary.

For analog signals this require an scaling factor and an offset Possibly together with limits for maximum and minimum values. It could also be done by assigning the end points for the logical and physical limits (like 0-65535 -> 200-4000).

Possibly a "out of range" signal could be generated as a pair of optional digital inputs for each analog input.

This can be done separately if necesary but I would like to see it in the I/O driver.


/Johan Bengtsson

----------------------------------------
P&L, the Academy of Automation
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------


-----Original Message-----
From: MIME :[email protected] [SMTP:MIME :[email protected]]
Sent: Thursday, January 27, 2000 8:27 PM
To: [email protected]
Subject: Re: LinuxPLC: Forcing

On Wed, 26 Jan 2000, Rick wrote:

> I think all signals that are output to hardware require a scaling
> factor. In the case of a bit the scale factor is either 1 or -1 or 0.
> In instances where confusion is likely use the default scale factor of
> 1.

What would be the purpose of this scaling factor?
What would it do to a bit, word, float, int and all other data types?

> I think there is also secondary need that is somewhat related. There
> have been many times when I wished I could invert a rungs result before
> writing it to the coil. I always ended up adding another rung to do the
> inversion. What if we had an inverting coil that be selected instead of
> a normal coil? This would also address the "invert need" in an obvious
> and un-hidden way.

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
On Thu, 27 Jan 2000 [email protected] wrote:

> Different types of I/O modules have different scaling for the
> same thing.
>
> Some modules I have used are scaled 800-4000 for a 4-20mA signal
> other are scaled 400-2000, yet other are scaled 0-65535 and so on
>
> I would like to be able to handle this in the I/O driver to be
> able to change from one type of module to another without affecting
> the rest more than necesary.

OK, seems reasonable, write it.

>
> For analog signals this require an scaling factor and an offset
> Possibly together with limits for maximum and minimum values.
> It could also be done by assigning the end points for the logical
> and physical limits (like 0-65535 -> 200-4000).
>
> Possibly a "out of range" signal could be generated as a pair of
> optional digital inputs for each analog input.
>
> This can be done separately if necesary but I would like to see it
> in the I/O driver.

What we need here is a specification of how an analogue channel presents it's data to the PLC.

I would suggest something like

data from I/O driver

int scaled_data;
int raw_data;
BOOL failed_hi;
BOOL failed_lo;
BOOL failed_unk;
BOOL converting;
BOOL conversion_done;


data to the I/O driver;

int span;
int offset;
int hi_lim;
int lo_lim;
BOOL start_conv;
BOOL rest;


NOTE: I have not spent any time thinking about this. It's just there for ideas.


Dave West E-Mail: [email protected]
Semiras Projects Ltd. PGP public key available on request.


_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
J

Johan Bengtsson

Well, I don't think the "converting" and related signal are really needed. The particualr I/O driver should be processing them automatically in the same way as the digital I/O:s are processed.

The scaling (span+offset) is something I want in the configuration file where the signals are defined and not as inputs to the driver.

Perhaps there should be an option to store it as a floating point value too (I think that would be better for a PID engine).


/Johan Bengtsson

----------------------------------------
P&L, the Academy of Automation
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------


-----Original Message-----
From: MIME :[email protected] [SMTP:MIME :[email protected]]

On Thu, 27 Jan 2000 [email protected] wrote:

> Different types of I/O modules have different scaling for the
> same thing.
>
> Some modules I have used are scaled 800-4000 for a 4-20mA signal
> other are scaled 400-2000, yet other are scaled 0-65535 and so on
>
> I would like to be able to handle this in the I/O driver to be
> able to change from one type of module to another without affecting
> the rest more than necesary.

OK, seems reasonable, write it.

>
> For analog signals this require an scaling factor and an offset
> Possibly together with limits for maximum and minimum values.
> It could also be done by assigning the end points for the logical
> and physical limits (like 0-65535 -> 200-4000).
>
> Possibly a "out of range" signal could be generated as a pair of
> optional digital inputs for each analog input.
>
> This can be done separately if necesary but I would like to see it
> in the I/O driver.

What we need here is a specification of how an analogue channel presents
it's data to the PLC.

I would suggest something like...<clip>

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
J

Johan Bengtsson

hmmm, didn't think of that... I do however think I suggest that as a separate thing.... Not done with the thinking however...


/Johan Bengtsson

----------------------------------------
P&L, the Academy of Automation
Box 252, S-281 23 H{ssleholm SWEDEN
Tel: +46 451 49 460, Fax: +46 451 89 833
E-mail: [email protected]
Internet: http://www.pol.se/
----------------------------------------


-----Original Message-----
From: MIME :[email protected] [SMTP:MIME :[email protected]]

On Thu, Jan 27, 2000 at 10:39:22AM -0800, Rick Jafrate wrote:
> For a logical (bit) a scaling of -1 would invert it and a scaling of 0 would disable it.

> For the other data types the scaling number would be used to convert
> engineering units (i.e. inches, pounds, etc.) to voltage or current.

And then we can have thermocouple linearization...

Definitely "We'll Do That Later" stuff, thermocouples. But if you happen to
see the spot where it'll go later, put a comment there saying so.

This should also handle gamma-correction and anything else people dream up.

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
Top