RSSQL: PLC rollover count work around?

gregjwilson

Member
Join Date
Jan 2007
Location
Atlanta
Posts
28
I integrate our software into client systems and am using RSSQL to bring quantity counts in.
I'm using the DIFF function.
Many of the clients are not PLC savy enought to provide PLC rollover counts.
Has anyone found a cool way to work around the necessity of having a specific PLC rollover number? Not having the correct count is giving me some big data spikes.

Thanks!
 
I take the question to mean that you're logging the difference between a PLC register that's changing to an SQL database, and that that register counts from the max value back to zero periodically.

Try this:
1. Log the actual value instead of the Diff function
2. Reset the register to 0 after a read

Potential concerns:
1. You need to initialize the data to 0 the first time - that should be ok since you're there.
2. You're resetting the counter - make sure it doesn't have any dependencies, ie, the PLC program using it for other things.

This should achieve your goal of fixing that from the RSSQL end.
 
What is the PLC you are using? What datatype? What range?

For signed integers, let the PLC calculate the scan delta, and feed that to the database.

Run the delta calculation in the PLC as often as needed, which in your case sounds like it might be periodic. Write the data ever cycle.

In pseudo-code:

Timer_Done ->
Delta = CurrentValue - LastValue
LastValue = CurrentValue
DBWriteTrigger = True
Restart_Timer

Note that the Database transaction manager needs to reset the DBWriteTrigger in this case.
 
RD - I think he was asking how to accomplish externally to the PLC. That is a good way of doing it, though.
 
External would require that A) the datatypes be exactly the same in length and format (which type was never stated) or B) if integer, be properly sign extended (if moving smaller to larger type).

If moving from Larger to smaller type, the sign would probably be completely lost. I'm also not sure exactly how this "DIFF' command is working, or on what platform it's being used.
 
I'm trying to do this external to the PLC, just in the RSSQL transaction before it goes to the SQL data base. My problem is our software is running separately from the PLC (various types- we install at many different locations) controlling the process, we are monitoring counts from the outside. I can't get in and change customer code, or initiate anything: we just read registers.
Biggest issues are:
Count reset at end of shift.
Rework type count decrementing: RSSQL sees any lower number as a PLC rollover.
 
Couldn't he do either?

1. Do what I suggested, just writing values. I think the software does an OPC write - for example, it should understand '0' as a value instead of the bitwise representation (different for BCD versus 2s compliment and varying with data types).

2. your pseudocode except in the PC - seems like it could be insulated from data types...maybe...

It doesn't seem like this problem should be hard to take care of externally with software so that he doesn't have to modify the varying PLC programs.

rdrast said:
External would require that A) the datatypes be exactly the same in length and format (which type was never stated) or B) if integer, be properly sign extended (if moving smaller to larger type).

If moving from Larger to smaller type, the sign would probably be completely lost. I'm also not sure exactly how this "DIFF' command is working, or on what platform it's being used.
 

Similar Topics

I plan to have a setup where RSSql reads datapoints from a PLC via RSLinx and attempts to insert them into the database. If the database...
Replies
1
Views
4,238
Hi, I am currently in need of help with regarding of the ways on how to connect RSSQL to suitelink without using 3rd party driver...your reply is...
Replies
0
Views
1,098
Hello all I am a student and also very new to PLC's and RSSQL. I have a situation where I am trying to link rslinx classic to ms sql through rssql...
Replies
7
Views
2,293
I'm trying to get a string from the plc and store it in a database, but I can only get the first byte, I know there should be an easy solution to...
Replies
0
Views
1,922
Hi Everybody, While I am trying to start configure RSSql,I m getting Error(33190)'The service could not validated using specified username and...
Replies
0
Views
3,454
Back
Top Bottom