Bobbias
Member
I'm working on a small project to learn some more PLC programming, and I've come across a small problem.
Before I mention the problem itself (aside from the title) I'll give you guys a quick background so you have a better idea of how muh I know.
I've been programming computers off and on as a hobby since I was about 14 (tried when I was 12 and quickly gave up). I'm 21 now, and I'm in my second year of college (though on my first co-op placement, because I didnt find one last year).
Coming from a programming background,I understand a lot of what I'm doing with PLCs, and I'm really just trying to learn how to convert my knowledge of programming languages into programming a PLC. (I end up making a lot of state diagrams and such.)
Anyway, here's what I'm doing with the project:
I need to have 4 push button inputs, that must be pressed in a specific order (1-2-3-4). If an incorrect button is pressed (including repeting a previous button), or the sequence is not input within 3 seconds, the "incorrect" light quickly flashes for 3 seconds, and then the program resets itself. If the correct buttons are pressed within 3 seconds, the "correct" light flashes.
I've got most of it coded, but I've run into a snag in the way I had planned on programmning the light flashing. I'm using a timer set to every .2 seconds, trigger a counter, and swap the status of a light (the light is latched or unlatched depending on what state it is in). I'm trying to watch the counter to see whether the bit 0 of it's accumulator is a 1 or a 0 to decide which state the light should be in (essentially using a mod 2 counter).
I'm currently being told I must specify the address to the bit level...
I'll attach the .rss file, so you guys can take a look (and give me any pointers on how to better do stuff, or tings that might not work as intended)
Before I mention the problem itself (aside from the title) I'll give you guys a quick background so you have a better idea of how muh I know.
I've been programming computers off and on as a hobby since I was about 14 (tried when I was 12 and quickly gave up). I'm 21 now, and I'm in my second year of college (though on my first co-op placement, because I didnt find one last year).
Coming from a programming background,I understand a lot of what I'm doing with PLCs, and I'm really just trying to learn how to convert my knowledge of programming languages into programming a PLC. (I end up making a lot of state diagrams and such.)
Anyway, here's what I'm doing with the project:
I need to have 4 push button inputs, that must be pressed in a specific order (1-2-3-4). If an incorrect button is pressed (including repeting a previous button), or the sequence is not input within 3 seconds, the "incorrect" light quickly flashes for 3 seconds, and then the program resets itself. If the correct buttons are pressed within 3 seconds, the "correct" light flashes.
I've got most of it coded, but I've run into a snag in the way I had planned on programmning the light flashing. I'm using a timer set to every .2 seconds, trigger a counter, and swap the status of a light (the light is latched or unlatched depending on what state it is in). I'm trying to watch the counter to see whether the bit 0 of it's accumulator is a 1 or a 0 to decide which state the light should be in (essentially using a mod 2 counter).
I'm currently being told I must specify the address to the bit level...
I'll attach the .rss file, so you guys can take a look (and give me any pointers on how to better do stuff, or tings that might not work as intended)