RSLogix5000 Analogues

JonAW

Member
Join Date
Sep 2013
Location
Somewhere
Posts
121
Hi guys,

Another quick question for those in the know:

When using analogues the raw data file is produced as an INT. Throughout my program I have used DINT's for transferring and processing values. Is it possible to allow the program to compare an INT directly with a DINT? Or do I need to copy the INT's to DINT's before comparison?

thanks

Jonny
 
What analog modules are you using..?

If ControlLogix (1756-) you can get the modules to produce the channel data to the controller already scaled to engineering units, so nothing is needed in the controller. You have to set the data format to "Float data" when installing the module (this is the default setting), then configure each channel signal min/max and engineering unit min/max to do the scaling.

If CompactLogix (1769-) The data is indeed produced as INT values, and you will have to convert this to engineering units.

Sadly, most (if not all, I haven't checked) CompactLogix processors don't have the SCP (Scale with Parameters) instruction, and SCL (Scale) is only available in Function Block and Structured Text languages. If you are able to use SCL, then the input parameter needs to be a REAL, for which you can simply MOV the INT to a REAL for use in the SCL instruction. If you don't want to, or can't, use ST or FB, then consider using an Add-On Instruction (AOI) to do the scaling. There are many examples of AOI's to do this scaling.

Alternatively you can "roll-your-own" conversion using the following formula, which is the formula used by the SCL, SCP instructions.

Math instructions accept operands in mixed data-types, converting as necessary.

2014-09-30_162519.jpg
 
Thanks for the replies guys.

No, scaling is not an issue for me, I just set the engineering units or work with the percentage format. It does affect the resolution a little but for what I need is perfectly acceptable.

Yes 1769-xxx modules.

I'm just comparing using commands like equ etc but I also have to carry out some simple arithmetic. Would that require the converting to DINT?

If I have to convert to DINT, should I use the COP or the FAL instruction to do this?

thanks
 
It is not necessary to convert to DINT. The Math and Comparison instructions can mix and match data types.

Text from the Help file on Compute (the category) Instructions:

You can mix data types, but loss of accuracy and rounding error might occur and the instruction takes more time to execute. Check the S:V bit to see whether the result was truncated.

The bold data types indicate optimal data types. An instruction executes faster and requires less memory if all the operands of the instruction use the same optimal data type, typically DINT or REAL.


OG
 
Thanks for the replies guys.

No, scaling is not an issue for me, I just set the engineering units or work with the percentage format. It does affect the resolution a little but for what I need is perfectly acceptable.

Yes 1769-xxx modules.

I'm just comparing using commands like equ etc but I also have to carry out some simple arithmetic. Would that require the converting to DINT?

If I have to convert to DINT, should I use the COP or the FAL instruction to do this?

thanks

You will not be able to use either COP or FAL.... The ChxData members of the module-defined input tag cannot be addressed as an array, which is the domain of COP and FAL instructions.

You will definitely have to address each channel data value uniquely, so you can use any math or compare instruction. And as you have been told, you can use the INT data directly to perform any math or comparison. All math and comparison instructions accept operands in any data-type, automatically converting as and when required.

You would gain better precision if you scaled RAW data coming in to a REAL percentage, or even engineering units, but if you are happy with only 100 "steps" in the incoming analog value, then feel free to continue to use the percent scaling on the card.
 
Hi Guys,

Thanks for all your help and insight.

You would gain better precision if you scaled RAW data coming in to a REAL percentage, or even engineering units, but if you are happy with only 100 "steps" in the incoming analog value, then feel free to continue to use the percent scaling on the card.

Daba, the percentage scale is a little misleading as I did think that 100 steps would be very limited. This is my first time using a compact logix and so to be sure I tested an add-on I had built for a VSD motor control. When testing the analogue output and input I realised that the actual integer values used are 0-10000 instead of 0-100 which gives a reasonable resolution.

regards

Jonny
 

Similar Topics

Hi! So my problem is a little funky, I had Studio 5000 v 24 and 30 installed, but forgot to install RSLogix (which I cannot go without). Is there...
Replies
2
Views
111
So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
426
Hello everyone, I have an RSLogix5000 project which is running live in the factory but I need to make some changes to the logic. I want to test...
Replies
0
Views
1,119
Good Morning Everyone, I'm looking to use the GSV instruction to get I/O fault codes for my project so I know if there's a comms issue in my E/IP...
Replies
5
Views
863
The machine is running production. When trying to go online with the laptop the whole machine looses communication and faults out. Drives, HMI...
Replies
13
Views
1,929
Back
Top Bottom