Directlogic 06 and F0-4ad2da-1

AGENTTINFOIL

Member
Join Date
Jul 2005
Location
Louisville, KY
Posts
222
I am trying to write some code for an 06 processor for an analog signal 0-20 mA. I am using a F0-4ad2da-1 analog card and so far I think I have the code figured out but the math I just am not comprehending, so I guess it is safe to say the scaling is kicking the **** out of me. I have a Hygrometer that is detecting moisture in the plant air line and I am using a analog out from this device that is already scaled. I want to use channel 1 input on the analog card to recieve this already scaled signal from the Hygrometer. I want to use this data to set a comparison bit when the signal hits 20 mA. eventually we want to be able to graph the activity on this Hygrometer to track the history, but for right now I just need to get this thing working. I can post the code that I have so far if some one would like to see it, and maybe someone could walk me through the steps.
 
Are you using DirectSoft5? Use IBoxes to set it up. IB-462 to setup the module. IB-423 to scale it. Set 'Low Engineering' to K0. High Engineering to K1000. This will give you zero to 100.0 percent humidity.
Do a Compare instruction to test if the number in the V location is equal to 1000 (or greater than 998 or so if you want some tolerance).

AD has a seperate manual for the IBoxes. Go here.
 
keithkyll said:
Are you using DirectSoft5? Use IBoxes to set it up. IB-462 to setup the module. IB-423 to scale it.

I talked to tech support at AD and the guy that I had talk to said that he was not that familiar with the IBOX yet and suggested that I write the code, so I did. although I really wanted to use the IBOX I thought it would be good experience to try it with out them.
as far as the scaling how does that work if the analog out on the hygrometer is already scaled and I want to supply this out to the analog card in on the 06? I currently have high set to a given value and the analog out is 20mA. since I am bringing this into the 06 how will that change things? or does it? This has got me confused...

Thanks for the link I will have to study it. this is some new info that looks like it may shed some light on this for me.
 
Last edited:
I've written code too for the DL250. The IBox is for 'kids' that don't know how to program. It makes the process nice and simple by doing everything in the background. I use them now because it makes code easier to read.
You say your signal is already scaled prior to input to the PLC. I don't know what you mean, but it doesn't matter. 0-20mA coNverts to 0 to 4095 inside the PLC.
The numbers you have to work with is 0-4095. To scale it to 0-1000, you divide it by 4.095. That means multiply by 1000, then divide by 4095.
The IBox does this math automaticly.
 
keithkyll said:
I've written code too for the DL250. The IBox is for 'kids' that don't know how to program. It makes the process nice and simple by doing everything in the background. I use them now because it makes code easier to read.
You say your signal is already scaled prior to input to the PLC.

Yea that is what I kinda thought too. I want to be able to write the code with out the IBOX... As far as the already scaled signal prior to the PLC, I figured that would have threw you a curve ball. the hygrometer is simply a device or controller that recieves a signal from a sensor in the air line. I have to set the device up to read in what ever engineering units I want it to display and I have to scale the analog signal in this device. I may be wrong in assuming that the analog out on this device is already scaled but I am pretty sure that it is, because I had to set the scaling in the device if I intend to use the analog out " which I do" so, if the device is reading 100 the analog out leaving the device should be 20mA.

I hope this is making sense now, I debated whether or not to even post my issue.
 
You're on the right track. The simple fact is what the PLC 'knows'. It only sees one thing - 0-20mA. This is presented to you as 12 binary bits. Zero mA is all bits off. 20mA is all bits on. Nothing else matters.
Convert to BCD, and you get 0-4095.

Your scaling is 100% humidity equals 20mA output. Inside the PLC, 100% humidity now equals 4095. You need to rescale it back to 0-100 or 0-1000.
 
Ok, when the 06 gets the 20mA and all the bits are on. The value in the specified memory location should be 4095, Correct? and if so then I should be able to simply use a comparison instruction to say when 4095 is equal to that memory location set the instruction. or will I have to scale the analog signal for the PLC?

you lost me on scaling it back
 
Rung 26 won't work. 4095 divided by 4095 equals 1. You will get one with 20mA, and zero the rest of the time. There's another problem. You're doing the math in the accumilator. That means you are using the PLC's CPU to do math. When you're done, you must write the results to a memory location. Load V3000, MUL 1000, DIV 4095, OUT Vxxxx.

Start reading at page 5-12 here. If you copied their example exactly, it will do what you want.
 
Thanks you have given me some things to look at, I will try to play with it some more when I get to the plant. I know that I will get this, some time's I have to see it for it to sink into my thick head. The code that I have so far I have just started on and I have really left the math part unfinished since I am unsure how to do that part. I really appreciate your help and I will post again tommorrow and I hope to be closer and maybe after a few dings in the skull I may solve it.
 
keithkyll said:
Sorry for throwing you. You are correct. Compare to 4095. I would do 4085 or 4090 to allow for tolerances.

I did not see this post before I already posted. So, I do have that part correct... That's excellent!! One more question, when you say to allow for tolerences what do you mean by that?
 
What if your Hydrometer is slightly out of tolerance, and outputs 19.98 mA for 100% humidity? Then your full scale would only be 4091.
With an air line, 90% or so humidity is as bad as 100% in my book, so why go the full scale? Humidity meters aren't perfect - soaking wet, it might only output 99%, for example.
 
AGENTTINFOIL said:
... I want to be able to write the code with out the IBOX...
Why? With previous versions of software, you need to write code to read the card, then use the accumulator to do math and digital filtering. They fixed this in DS5 with IBoxes. Now you use an IBox for the particular function, and just plug in your values and 'V' register addresses. That's how it should be, and that's how code should be written.
The old way is obsolete. The IBox does all the coding in the background, and that's where it belongs.
In your case, all you need is IB-462. After that, your Compare logic. Why complicate it?
 
Last edited:

Similar Topics

Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
32
Views
781
Is it correct to say that the dl05 program when uploaded does not store the current value in a v memory location? I have a customer that has one...
Replies
8
Views
3,094
Hello everyone, Background: We have a Directlogic 405 PLC that has an output card that has all solenoids on it. These solenoids are on plugs with...
Replies
9
Views
2,893
Can someone please explain the sinking and sourcing with respect to DL405 series PLC? I have already been through the manuals. Explanations with...
Replies
3
Views
1,994
I'm new to the whole Drum idea. I tried to figure it out but couldn't. I'm wanting to use a drum or sequencer to seqence a V memory depending on...
Replies
1
Views
1,455
Back
Top Bottom