how to access Rslogix Counters from xternal source

fusion

Member
Join Date
Jul 2005
Location
Auckland
Posts
26
i am trying to access the counters i.e C5:0 of Rslogix500 from an external source i.e C+ based program, so that i can change the PRESET on the counter. Is there a way of doing this? are there other ways around this problem? see the attached file for more info on this.
 
fusion,

RSLogix is a proprietary owned program, and the code is not public-domain. I have never heard of anyone successfully figuring out enough of the code to be able to change it. There are ways to input counter presets, of course. The easiest is to install 3 or 4 digital inputs on the PLC, and then send your C+ program outputs to these inputs. Then change the PLC program to read these inputs and use the value as the counter preset. With 3 input signals, you can input 0-7, with 4, 0-15. You can multi-plex these and get 2 or 3 decimal digits.

PS: Did you forget to attach the file?
 
Last edited:
right. that sound gud. the attchment is here now.
Um the multiplexing, can that be done by the plc? or do i need an external ic?
 
fusion,

You would have to do part of the multiplexing routine in your C+ program, and part in the RSLogix. You would set up a routine to send the "200" decimal number, 1 digit at a time. This requires some type of handshaking between your program and the PLC. This could be done with another digital input that serves as a signal to swap digits. For example you could set up a counter that counts 1,2,3 and increments every 5 seconds. Then every 5 seconds you trigger the handshaking bit, then send 1 digit, say start with the "2". In the RSLogix, you add ladder rungs to look at 4 inputs and calculate their binary value then multiply by 100 (the digit place value). Then set the handshaking bit to 0, then back to 1, and send the second digit, "0", you send, read, and multiply by 10. The third digit, "0", you multiply by 1.

If you have 12 spare digital Inputs on the PLC, then you can send your number without multiplexing. In either case you must have some way of sending digital 1's from your C+ computer to an output device, which in turn sends them to the PLC as inputs.

Another way if your C+ program can output ACSII values to an RS232 port, is to send the value via an RS232 port as an ASCII value. Then you could read it directly in the PLC without any multiplexing or interpretation.
 
Last edited:
hmm the first method sounds right, the micrologix im using is 1500 which does not support ASCii as instructed in the HElp menu of rs logix 500 so im going to try and do the first method.

another method i tried is seting the preset of the timers as an rslogix binary file (B3:0/0) and sending each of the three digits(200 = 2 , 0 , 0) to the individual binary file and then putting them together. This is very similar to your described method. But im having trouble making the presets a binaryfile.

đź“š you have alot more experience with this than me so im gonna try your method first.
Thankyou. 🍻
 
Lancie's last suggestion is the most flexible, assuming a port is available and can be used to process an ASCII string. And, regarding your own use of terminology, it appears you wish to change the preset AS IT EXISTS IN THE PLC. RSLogix500 is the software which runs on a PC and is used to program the PLC and does not refer to the PLC itself. For more detailed answers it would be best to note the exact model number of PLC you with to affect.
 
the plc is micrologix 1500, CAt 1764, Der-A, Rev-A, FRN-1. (1764-A-A-1) THAts all i can find on the PLC. prety old plc. 12I/O ports.
 
fusion,

If you can get your Counter Preset value loaded into the ML1500 as a Binary number, then just do a ladder rung with a MOV (move) command to move the 16-bit Binary word (B3:3) into word C5:0.PRE, for example.
 
Last edited:
im off to a lecture now. will work on project later on and post replies. thanks fo rthe help soo far. mush appreciated.
 
Whats wrong with a DDE link. You will need a version of RSLinx other than lite. If VBA in excel can poke a value into an address in a micrologix then I am sure a smart programmer can make a C++ program do it.
The other alternative is to write or buy a DF1 driver. DF1 is an open protocol and if you have the time you can write your own code to set the preset or just purchase one from the web.
However I suspect this is for a uni assignment, so the cost or the time involved might rule out the DF1 route.
Regards Alan Case
 
hi alan, yep i could do the DDE hot, but the POKE feature on the rslinkx we have (version 2.10.118) isnt avaiable according to the help menu , so it does not support that option. and the DF1 is too costly and time consuming for a uni proj and u seem to agree with that. With the limited options and knowledge available to me from uni i can only do so much.
 
If you only want to change a counter preset and u dont care how it is done then use the 2 pots under the front left cover. Takes a bit of programming but nothing real hard about it.
Regards Alan Case

PS it is not the version number of linx that is stopping the poke but the fact you are using the free lite version. Any of the paid versions will do a poke but the cheapest is probsbly $850 NZ so that is out of the question too.
 
how about |--------|Mov source I:3.0 - Dest N7:0|--------|
|--------|FRD from N7:0 - Dest N7:1|-----------|
|--------|TOD from N7:1 - Dest N7:2|-----------|
|--------|MOV from N7:2 - Dest B3:0|----------|
| -------------------------------------(END)---|

so if i send the BCD number to I:3.0 from my C++ program, then theorotically it will be kept in memory register, converted from BCD to binary,save in memory, change binary back to BCD and then put in to the Timer preset... but the timer preset does not accept inputs from N7 or B3, so that sucks!
 
1. Why the final conversion to BCD? It's not needed and will probably mess things up.

2. MOV the final number directly into the counter preset - MOV N7:1 C5:3.PRE.
 
Last edited:
i am trying to send binary numbers to the plc on I:1/1. How can i tell the plc when to start reading and then stop reading the numbers iam sending.

for eg 200. so i send 2, 0 , 0.. will the plc accept it as BCD, yes. but wat other data functions do i send with 200 to make the plc start and stop reading and not expect anymore input?

And i am sending the most significant bit first, is that correct or do i need to send least significant first?

i read the communication commands and i found the micrologix1000 information on Unprotected Write to plc which looks like this

C = |DST|SRC|CMD08|STS| TNS |ADDRESS LOW|ADDRESS HIGH| DATA |

R = |SRC|DST|CMD48|STS| TNS |

What excatly does that mean?

I had alook at a forum refered to me by KEN MOORE:-

http://www.plctalk.net/qanda/showthread.php?t=14870&page=2

that page descrribes what i want to know. now im gonna try and implement that into C code to see if the bits will/wount change.

The bit will only go to 1 or 0.
im gonna try and send word to I:3.0 and see if it will accept the word. and then use the MOV instruction to place it into the timer preset T4:1.Pre .
 

Similar Topics

Hi Guys, I am using rslogix 5000 at work and we have different zones with different PLCs and some of them have devicnet scanners as well which...
Replies
4
Views
2,838
Hi guys, I am currently working with the setup: Rslogix 5000 + CompactLogix L24ER-QB1B controller + 1769 Analog IF8 module. For what i know...
Replies
0
Views
3,853
Hi, One of our clients is wanting to view PLC Code offline and online to diagnose/fault find. The problem is, he is the type of guy who will...
Replies
5
Views
17,855
I am working in RSLogix 5000 version 17, 18, 19 and I have several tags: alias DINT: Pump_1_start Pump_2_start . . Pump_X_start Base DINT[6]...
Replies
5
Views
4,500
HI, I'm new to PLCs and rslogix. I was concerned about the floppy getting messed up so I tried to copy the license before I read that it will...
Replies
8
Views
2,536
Back
Top Bottom