PLC Code Help GE Fanuc 90-30

I am suppose to receive my POT and voltmeter in the next couple weeks, but I have attached my main program and I have no errors when I run the verification. Does this programming method look correct for how I want my PLC to operate with the POT and voltmeter to enable call blocks? I have attached a PDF
 
It is possible that you will see values greater than 32000 in %AI001. Nominal scaling is 0 - 10 volts corresponds to 0 - 32000. A signal level of 10.2 volts would give you 32600 in %AI001. Your code doesn't do anything when that is the case.
 
Ok, so I should create new call block, or some instruction when the value is greater than 32000.

My power supply has a 24V output and I am going to use that supply for my analog input. Do I need to drop that voltage down to 10V for the analog input? Or will the 24V supply work?
 
Do I need to drop that voltage down to 10V for the analog input?
The specs for the IC693ALG220 module list the maximum voltage as +11 volts, so yes, I'd say you should install a fixed resistor in series with the pot if you're going to use the PLC's 24 VDC supply.
Ok, so I should create new call block, or some instruction when the value is greater than 32000.
You could do that or you could simply delete the LE_INT instruction in the last rung. Put in whatever logic you think you need. I'm simply pointing out that your logic as written doesn't cover all possible values in %AI001.
 
Ok, thanks, putting the resistor in series is what we talked about doing before.

Any idea how to enter RUSSB's code into my LD Block, from one of his responses before. I was able to manually enter most of the first rung but didn't know how to enter the last half.
 
Does this programming method look correct for how I want my PLC to operate with the POT and voltmeter to enable call blocks?

charlieukfan85,

Have you given any thought to what happens to an output or internal coil that is no longer scanned by the PLC? Such as you just turned a bit on in a subroutine, then exit the subroutine?
 
Last edited:
Yes I given some. When I am in a subroutine I need to be able to get out of it when my voltmeter is no longer reading within the limits of that subroutine. And all outputs need to be reset when that subroutine is no longer enabled.

I'm guessing when it is in the subroutine it is not going to jump out of it when the voltage changes and new subroutine needs to be enabled, and the outputs need to be reset.
In each subroutine do I put a few lines of code that will read the analog input with the LE,GE commands and have them call the MAIN program again or do they call the program that they should be associated with, and if the new subroutine needs to be called then reset all outputs before leaving the subroutine it is currently in.
 
When I am in a subroutine I need to be able to get out of it when my voltmeter is no longer reading within the limits of that subroutine. And all outputs need to be reset when that subroutine is no longer enabled.

Yes you have this correct.

I'm guessing when it is in the subroutine it is not going to jump out of it when the voltage changes and new subroutine needs to be enabled, and the outputs need to be reset.
In each subroutine do I put a few lines of code that will read the analog input with the LE,GE commands and have them call the MAIN program again or do they call the program that they should be associated with, and if the new subroutine needs to be called then reset all outputs before leaving the subroutine it is currently in.

But If I'm understanding how you want to do it you will be one PLC scan late. Kind of like closing the barn door after the cows got out.

The main program always runs, it's the subroutines that are conditional.

Hint: Think about how the PLC scans, and the placement of the subroutine call blocks.
 
Ok, well if the Main program is always running then wouldn't the PLC know to switch subroutines by my program code and not by additional logic of scanning the analog input within the subroutine? And what I would need to do to my program is have the subroutines reset when they are no longer enabled by the Main program.
 
Ok, well if the Main program is always running then wouldn't the PLC know to switch subroutines by my program code and not by additional logic of scanning the analog input within the subroutine?

Yes, but here comes the sticky part. If the main no longer allows the subroutine to run how are you going to turn off the bits in that subroutine?


Remember the PLC and the program will do what you tell it to do, not necessarily what you want it to do.

There is an easy solution. You just have to think how the PLC scans (top to bottom) and place your logic accordingly. Plus use permissives or conditionals in the subroutine to turn off the bits.

For a test you can write a program (forget about your analog until you get your hardware) and use a digital input to enable a call block. Write some code in the subroutine that the call block enables. Have the code write to an output. Now turn off the input so that the subroutine is not enabled. Report back as to what happens to the output.
 
May I make a few suggestions? 1. Use VersaPro if you can not use Proficy ME, at least it is Windows based. 2. Forget about 'subroutines' until you have mastered the _Main block. 3. Look into the system bit contacts %S5 and %S6 for flashing outputs. 4. Get the hardware as soon as you can, "experimenting" on the bench is fun and a very good learning experience. 5. Ask detailed questions here, you will get detailed answers.
 
I do use VersaPro and I am not sure what the contacts %S5 & %S6 are??
I will not be able to work on my PLC till about the middle of next week and i will experiment as much as I can and it has been fun working with it so far.

I have been thinking about Milldrone's post and does the Main program I currently have operate the way I want it to? If so, the big problem I am going to encounter is getting by bits to reset when the subroutine is no longer enabled, correct? I will do the test with the digital outputs, but will I be using the ResetCoil command to reset my bits and have to figure out where to use the command?
 

Similar Topics

Hello, i am currently trying to create a plc programme from my Tia portal v16 for a package filling machine. But i am kinda new to the plc stuff...
Replies
48
Views
17,428
i am new to these things. I have no intention of using this in a commercial way whatsoever. I wanted to write a small plc programme for myself. We...
Replies
18
Views
7,916
Hello Guys, I need your help to look into my code and please tell me if this code will work? Logic If there will be part or product on conveyor...
Replies
7
Views
2,864
Hi every body. I am new here also very new in PLC coding. I need to write ladder code for the following conditions. 1. When you press the button...
Replies
46
Views
10,126
Hello there, appreciate if someone kind enough to teach me or show me how to solve this problem. Realy headache with this.. Thanks!! =) I'm...
Replies
15
Views
8,326
Back
Top Bottom