Ml1400 usage

John shui

Member
Join Date
Jul 2011
Location
vancouver
Posts
17
Hi friends, I found there're a lot of skillful peolpe around here such as Mickey and Ron Beaufort. They gave me very good answers for my questions. Here,I want to thank them again.
I have devoloped a lot of different programmes before. I have plenty of programme experience such as C++, assembly language, and PIC18 series. But I am a new member for ML1400. I believe I will become skillful soon with so many friends' help. Here, I have some questions. I hope someone can give me good answers soon.
1. How can I use "continuous scan test" and "test single step" to debug my programme.
2.Is "SBR" instruction always true? That looks like I don't really need that. What's the nest subroutine meaning? Except using "JSR" instruction to build subroutine, how can I build subroutine efficently? I don't want the subroutine is one of lad files, I want it just is a small section which can be attached anywhere in the lad file. Can you give me some example for how to build a good subroutine?
3.It looks like there is something wrong with one of my programmes:
controller properties:processor type: BUL.1766 Micrologix 1400 series A
However,processor status: OS catalog number:1400 series B, proceesor catalog number:1766_LEC
Here, one shows series A, another shows series B, they don't match with each other. But it works well. I have no idea for that.
By the way, what's 1766_LEC meaning here?
4.I don't think I can develop ML1400 programme in a professional way. Can you give me an example with 3 lad files, 4 subrountines, interrupt, and "JMP" instruction? Can you give me some advice how to build programme professionally?
5.I believe an efficient debug way is very important for programme developing and troubleshooting? Can you give me some suggestions about this issue. How to use "TND" efficiently?
6.Do ML1400 have "Watchdog" function?
Thanks.
 
1. How can I use "continuous scan test" and "test single step" to debug my programme.

In 7 years I have never used either of these modes in the PLC (knowingly anyway), generally if you're programming and making edits online you first verify the edits then test the edits.

2.Is "SBR" instruction always true? That looks like I don't really need that. What's the nest subroutine meaning? Except using "JSR" instruction to build subroutine, how can I build subroutine efficently? I don't want the subroutine is one of lad files, I want it just is a small section which can be attached anywhere in the lad file. Can you give me some example for how to build a good subroutine?

JSR _can_ always be true, but you can also put logic infront of it to make it false. Generally subroutines are used to make the code a bit neater and to group like code together. What you need to remember is that using a subroutine multiple times in a ladder program can make troubleshooting an absolute nightmare as the code is scanned more then once per scan cycle.


3.It looks like there is something wrong with one of my programmes:
controller properties:processor type: BUL.1766 Micrologix 1400 series A
However,processor status: OS catalog number:1400 series B, proceesor catalog number:1766_LEC
Here, one shows series A, another shows series B, they don't match with each other. But it works well. I have no idea for that.
By the way, what's 1766_LEC meaning here?

These are ABs catalog numbers, could be hardware ver A and OS version B, wouldn't worry too much about it.

4.I don't think I can develop ML1400 programme in a professional way. Can you give me an example with 3 lad files, 4 subrountines, interrupt, and "JMP" instruction? Can you give me some advice how to build programme professionally?

What you need to remember about JMP is it acts like GOTO in other languages. You put a JMP with some logic on one rung, and the matching LBL on another rung. It will move from the JMP to the LBL. JMPs are dangerous creatures in the way that you have to be careful not to use too many and risk hitting your watchdog timer and faulting out or having an endless loop.

5.I believe an efficient debug way is very important for programme developing and troubleshooting? Can you give me some suggestions about this issue. How to use "TND" efficiently?


TND is kind of deceiving, it can be used to skip portions of code, but if you don't check your changes against the entire code base, you won't know for sure if they have any adverse effects. And generally speaking using a TND on a system thats in production is a bad idea. That being said, I have used them before ahead of new code to make sure it wasn't scanned until it was complete and tested.

6.Do ML1400 have "Watchdog" function?
Thanks.
Yes it does. They generally default to 100ms.
 
Thank you, Christoff84,

You teach me a lot. But I still doubtle about some issues.
1. Without using "continuous scan test" and "test single step",how can I control the programme running and check something in each scan cycle.
2."help" tells me that SBR instruction is always true, it is optional,but recommended. If I use JSR to call one subroutine, I can use END or RET to return, what's the difference between them?
3.We can use TND to block the new code that wasn't checked. Maybe we can use a pair of MCRs to block them too. I think TND can block the code only at the end of the programme, but MCR can be put in anywhere to block any codes we don't need them to run.

Thanks in advance
 
1. The SBR command was required on much older AB units. It is included so that translated code would not error when that instruction was encountered. It may serve as a reminder that this is a subroutine but then all ladders other than #2 are subroutines. (Either called directly or by interrupt)

2. Even the END instruction is provided automatically at the end of the subroutine ladder. Use RET if you have conditions to terminate the subroutine before the end of the ladder.
 
TND and MCR are not the same and do not act the same. TND ends the scanning of that code and returns to the LAD file that called the subroutine or if in LAD 2, ends the scan cycle.

The MCR instruction still scans the code between both MCRs, however it evaluates everything as False. So every output will default to off if OTE is used.
 
You teach me a lot. But I still doubtle about some issues.
1. Without using "continuous scan test" and "test single step",how can I control the programme running and check something in each scan cycle.

I tend to test edits on live machines where switching out of RUN mode isn't an option. When you have the opportunity to test using these modes it's probably not a bad idea, I've just personally never had the chance and have such not used them.

2."help" tells me that SBR instruction is always true, it is optional,but recommended. If I use JSR to call one subroutine, I can use END or RET to return, what's the difference between them?

I mis-read your question earlier about the SBR and JSR. SBR is an old holdover from the PLC5 era, it used to serve a purpose passing data back and forth from the main routine to the subroutine, in SLCs/Micrologix it's more of a note/comment on the line then anything else. As Bernie said, anything that isn't LAD2 is a subroutine.

Bernie is dead on about RET, it can be used multiple places to end a subroutine based on conditions. It also used to serve a larger purpose in PLC5 with passing data from main routine to subroutine, but doesn't do that anymore in SLC/Micrologix. End is just that, the END of the subroutine. Where you can have multiple RETs, you can only have one END.

That being said, anyone who has to come after you and troubleshoot code that can jump back to the main routine in multiple places is probably not going to be too happy with you.

Generally with PLC programming, the simpler you can make it, even if it takes 50 lines of code versus 2 very complex lines, the easier it is to troubleshoot later.
 
here's something that should help answer all of the questions that you've been asking so far ... experiment with the ideas shown in the figure below ... each one of the ADD instructions is a "scan counter" ... in other words, the F8 locations will increment by one each time that the processor executes the rung ...

sprinkle plenty of these ADD instructions throughout your program – just be sure to use a DIFFERENT address from the F8 file for each instruction ...

when you put the processor into the Run mode, each ADD that's being executed will advance its F8 value very rapidly ...

now put the processor into the "Test Single" mode that you've been asking about ...

now the processor will stop executing the ladder rungs – until you give it the "go" signal ...

each time that you click the "Go Single Step" button, the software's red cursor will move forward one rung at a time ... you can watch it move forward in slow motion – and notice how the ADD instructions will tell you which rung is being executed – step by step by step ...

you can even watch how the processor moves from one subroutine to another ...

once you understand how that stuff works, try putting an MCR setup around one of your ADD testers ... try the JMP and LBL instructions ... etc. ... etc. ...

have fun ... the more you play the more you'll learn ...

.


learn_scans.jpg
 
ML1400 usage with HMI

Thank you give me the example to try the "scan" mode. There are still some questions here.
1. What does the"processor node" work for? If there are 3 ML1400s and 3 HMIs hook up together by hub(LAN), what number of the nodes can be assigned to each of them? Can the number keep the same between any of two?
2. Without the simulate function for RSLogix, how can we debug the programme in offline mode?
3. I can transfer file to HMI and upload the file from HMI by LAN. How can I use my laptop as a HMI to control my PLC in LIVE?
4. I tried to put "RET" instruction in one of my ladder file except lad #2, it passed the "vertify". When I downloaded it to PLC it was rejected. Error "navigate" something showed in the result window. What's that meaning? How can I fix that? If some programme passes "vertify", but there is still something wrong in somewhere, how can we do to remove the mistake before we download the programme into PLC?
Thanks
 

Similar Topics

Hi friends, I have some questions here. I hope someone can give me good answers soon. 1. What does the"processor node" work for? If there are 3...
Replies
1
Views
1,733
Hello, I am new here and have been working with PLCs for a few years now. I have been tasked with setting up a Micrologix 1400….. to a Cmore 10...
Replies
10
Views
477
Hi, We may of finally received out first v21 ML1400. IP address set, proceed to download standard file for our machines & at about the 80% mark...
Replies
10
Views
1,436
I have a Allen Bradely 1500 that has a cracked board. It still works but needs replaced (battery is no longer connected). To make migration easier...
Replies
10
Views
3,212
Hi, I've got a new project for a vacuum conveying system. We require to add another HMI to the existing system which will then feed 2 separate...
Replies
6
Views
1,821
Back
Top Bottom