Unity 7.0 on m340 Analog Output Block Scaling Problem

rc10forlife

Member
Join Date
Mar 2014
Location
Dallas
Posts
6
Hello All!!
I am new to the forum and have seen alot of good answers so far, but I have not been able to resolve the issue I am having. :mad: 36hrs now and no go.....

For the short and sweet:
M340 PLC with BMX AMO 0410 as the output card.
I am trying to take the value from an HMI or OIT and then run it through FB logic to scale it out to the 0 to 10000 raw value. Looked like I had it, until I noticed I am comming up with an output that is 100 shy at full scale. In structured text the logic that I had been given from an integrator is working correctly.

I tried recreating in FB and I come up at 9900 on my output where the structured text block comes up 10000. I have to have FB as the programming language.

I will attach examples of both. PLEASE HELP!!!! I know I am missing something easy, just not catching it.....

structuredtext works.jpg not working fb.jpg When in run mode.jpg
 
Customer request the out blocks resemble the in blocks. I tried scale block on output signal yesterday and it was not working.
 
You are absolutely correct that it does work that way. I did it with a scale block and it worked. However, the end user requires the logic to be in a DFB. So in better words - I have to write out the logic for the following equation:
Output would be equal to (INPUT minus InputMin) Multiplied by (OutMax minus OutMin) Divided by (InMax minus InMin) added to OutMin

I attached another jpeg of formula based on the Scaling block. I just am having trouble getting it written correctly in DFB for this guy.

formula.jpg
 
All,

I have attached the following:

A shot of the formula converted to FB.
A shot of the 3 types of DFB running.

Structured text custom block / a Built in Scaling Block to unity / and then another Block - the FB custom that comes up 9900 output value.

I have read I need to inject a .5 add somewhere. or possible multiplier???

not working fb.jpg When in run mode.jpg
 
If you really want to use your logic, it would be a lot easier to debug if you posted the logic in run mode. To do this Right click on your DFB and select Refine
 
Yep!!! I think it is more a real to int thing at this point. I am going to try something and then send screens if it doesn't work.
 
GeoffC,

THANK YOU FOR THE HELP!!!! Your tip to REFINE made me go back to the basics and trace the Math flow. I was right on the money with the INT to REAL being the culprit!!! Had INT values to soon in the logic equation. Using refine made it pop out instantly!!

Attached screenshot shows correct flow now.....

Now customer gets what they want and no using Para - even though it is the easiest way......

fixed.jpg fixed in MAST running.jpg
 

Similar Topics

Hello. I'm trying to set up an M340 with a BMX AMO 0410 and a BMX AMI 0410 in Unity Pro XL 13.1. While trying to set up the IODDT for the card...
Replies
8
Views
4,113
Hi, Is it possible to scale the 4 to 20mA output of a Vegaflex 63 TDR Level Senor mounted on an inclined horizontal cylindrical diesel tank with...
Replies
5
Views
3,215
I am familiar with RSLogix, Concept, and Telepace, but have not used Unity Pro S until the past few weeks and have a few issues I have not been...
Replies
2
Views
9,701
Hello. New to Unity and had a couple quick questions. Can a Modicon M340 output to a small multiline LCD screen and not a full HMI?
Replies
4
Views
940
Greetings, I'm new at PLC programming, but good a logic - so I thought. I've inherited a PLC system, which is presently operating in the field...
Replies
6
Views
2,450
Back
Top Bottom