Register use

Join Date
Oct 2022
Location
Antwerp
Posts
7
I'm absolutely new to PLC; I want to readout a slave giving me details on energy. I'm using ADPRW, and this reply is stored in a register. My question is: is this register updated after each scan, or does multiple responses go into a block of register ?
Are these registers volatile, and do I have to save them into a permanent register ?
 
I assume you are using Mitsubishi PLC, as the only ADPRW I know of is on Mitsubishi Modbus protocol.
This is not done every scan of the PLC program but depends on the speed of the communications for example 232 or 422 would be at a rate no more than 115kb/s, if Ethernet then this would be a lot faster, the nominal PLC scan time (dependent on PLC type), would be probably about 20ms & depending on communications overhead & amount of data probably about an update of less than one second could be in ms.
The register (s) where the data comes in will be updated at that rate, Mitsubishi registers can be retentive i.e. hold their data, what you would have to do is move the incomming data into retentive registers at a time rate to suit.
PLC's do not generally have large retentive storage memory so if you want any real history then you would have to export it in some form.
What is the data i.e is in instantanious kw, incremental kw used etc.
It would depend on what is coming in depends how you handle the data.
 
Yes, your right, it's Mitsubishi. The sample rate is 3 sec., given by a timer. That should be slow enough to transfer the data to a permanent place. No clue how that is done.
Tnx for your quick reply.
 
It is simple, I'm assuming you have communications with the power meter or what ever, I can certainly help with Mitsubishi what processor is it, the data i.e. is it actual power or accumulative.
What programming software i.e. GXDeveloper, GXWorks, PLC type i.e. FX, Q etc.
 
I do suggest that you post this in the Q&A forum, not many look at this practice area you will certainly get more responses, just as a matter of fact if you want to store some values in order over time is to use a shift register, this would consist of a range of D or R registers again there is some setting up to do i.e. setting in the PLC parameters either D retentive area or a file register "R" this is a bit like a hard disk but in ram. also if your incomming values are a real (float) then it will take up two 16 bit registers i.e. D100 + D101 as all registers in Mitsubishi are 16 bit & a float is either 32 bit or 64 bit for double precision floats.
 
Hello again,
as said, I'm new to PLC and to this forum. I'm trying to find my way. I'm using a Coolmay "all in one"PLC EX3G- 70KH – 44MRT – 485P – WP – S(12T8R).
22D/9;8 Relay O/P; 12Trans O/P; 7 inch HMI; PLC is compatible with FX3G, FX3U, FX3S.32K steps program capacity, 32K power-off retentive registers, support interrupt, linear and circular interpolation,

software GX2
 
This data, what do you want to do with it, i.e. log every x seconds a single value or is it more complex than that.
GX Works 2 is ideal, as it has structured format. The FX3U is a good little PLC, however, it appears you may have a clone Shenzen I do believe this is the closest to the genuine FX3 range ,many clones are not i.e. a compatible FX3U may only be an actual FX2.
Cannot help with the communications as such as I don't have the required hardware but depending what the data is & what you want to do with it programming is quite simple.
It appears it has just over 7kb of retentive memory so this would store 7000 integers or 3500 reals, so limited if you wanted to store more than this, however, i believe it may have File registers not sure how large these are but probably restricted depending on the program size as I believe it is stored in the same memory area which I think is 32kb or 16 k words.
 
You're right, it is 32kB
All data values in the SDM630Modbus smart meter are transferred as 32 bit IEEE754 floatingn point numbers, (input and output) therefore each SDM630Modbus meter value is transferred
using two Modbus Protocol registers.
 
Assuming it is compatible with FX3 then the following is a way of converting the two modbus registers to a float, It is possible that the protocol uses reverse byte mode so it is possible that you will need to swap the bytes in the registers, the first two rungs are used if this is so, the last rung shows how to copy the two registers un-swapped so if this is how the byte order is as it comes in then just use this, if the byte swap logic is required then the source for the block copy is programmed with the first byte swapped register Mod_Real_1_Swapped the pic also shows the labels as I set them in the global label list.
Of course, knowing modbus it is possible that the registers might be in reverse order so it will be trial & error to get them in the right order. If you have problems just post the raw data in the original registers as they come in I will look at it. At least, if you have the coms running & getting data then this will convert it to single precision float.

Code.png
 
Hello Parky,
I'm new here, and surprised about your help. I've been working and learning on my own for a month now, and all of a sudden the sun started shining. Thanks a lot. Your help is really encouraging.

Bert.
 
From Post #3, the data rate is about 0.33Hz, and there is a mention of moving the data to a more "permanent" place (whatever that means).

All computer programs are models of something in the real world; the primary design decision is the fidelity of the model.

  • How permanent? That is, how far back in time should the model cover? E.g.
    • should there be a record of every measured value throughout history, growing of order 10Mrecords/y?
    • should there be a record over the past week, i.e. the last ~300k values, with the oldest value being lost?
    • should there be a record over the past shift i.e. ~10k values?
    • Should there be a record over the past hour i.e. 1200 values?
    • should there be a record over the past minute i.e. 20 values?
    • should there only be a record (display) of the most recent single value?
  • What is to be done when the Modbus communication fails?
    • E.g. a placeholder marker (such as -999999.0) could be used for each sample missed when the Modbus communication link is down.
    • Or does each measured and Modbus-transferred value need a corresponding timestamp, so data gaps could be detected by finding gaps in contiguous timestamps.
  • How will the permanent store be accessed (web, HMI, etc.)?
  • How will the permanent store be displayed (graph, table, spreadsheet, google sheet, database, etc.)?
The answers to these queries may determine

  • where the permanent historical records are stored,
  • if they are stored, and
  • how they are stored.
The Modbus transfer and conversion of single measurements to 32-bit REALs are the easy parts; coding to satisfy the answers to the queries above will be the interesting parts.
 
It appears that the OP is polling the data once every 3 seconds or thereabouts, It is not clear what data is stored, at this time it's just a matter of conversion shown is every scan just to get it into float format, It is an interesting point about history, with the FX3, memory is limited to 32 k words, so perhaps only a limited storage, normally about 14 blocks that's 7k of retentive memory in the "R" registers, there is a limit using a shift register or block copy to 512 words so in effect 256 reals, so would have to be shifted 4 times as the function is 16 bit only. for each 1k of reals.
No idea about the HMI, perhaps it has logging functions or at least some sort of file handling.
This is also a clone of the FX3U, not sure if it has the same functionality, often they do not, some of the real cheap ones you cannot alter the PLC parameters which means unable to use the R registers where these have to be setup.
It is also possible that not all in-built functions will work again, some of the clones the firmware has not been updated so functions that work on FX3U Series C may not work.
 
The idea is to measure energy over a rather short time (15 min). This is given by the dig meter itself. It will be interesting to store these values over 24 h, and save them on a SD card.
But all that is not my worry at this moment. I'm completely new to PLC, and I would be very happy to see something (like voltage or Amps) appearing on the HMI. From there I will take further steps, like comparing production and consumption of energy, and taking action on this by switching on/off parts of the circuit, including batteries.
 
If I read that right, you want 15 min data to log over a 24h period, I have done something similar with AB powermonitors, I took the current accumulated value & subtracted the last value so for example if at 12:00 the reading was 12745.56kw then 15 min later it was 12752.53kw then take the first reading & subtract the current one i.e. 6.97kw (just an example).
Then these values were written to an SQL database.
so it gives a running value every 15 mins
This is easily acheived by using perhaps a reciprocating timer (no need to use very accurate timing i.e. clock pulses but you could). then on the timer up, just subtract the previous reading from the current, only thing you will need to do is at rollover, check for a negative value in the current one & compensate. This will only happen after a long period depending on the rollover of the read value
for a 32 bit float this is I think 3.4028235 × 10-38 which is big, probably not happen for many years but perhaps annother way round this is to zero the power meter at some point once a year if that is possible.
To do this, it sounds as if you need to convert (possibly copy into a float) the power value, sub the previous one then store this, perhaps the store could be done on the HMI, not used the one you have perhaps it has some sort of scripting language & the ability to store values into a CSV.
 

Similar Topics

I am attempting to reject a bottle If the label fails. The rejection works fine at normal line speed but at low speed the rejector fires (air...
Replies
35
Views
1,213
Hi everyone, I am working on a project that needs to expose the SV (Set Value) of a temperature controller to a SCADA system. SCADA <-...
Replies
4
Views
188
I'm pretty new to PLC's, so forgive me if I use the wrong terminology and whatnot. We have an issue at work where we have a flow meter that is...
Replies
10
Views
310
I would like to copy register N61:131 thru N61:147 into ST252:0 I keep failing What happens is I copy into ST252:0,1, 2 etc. What am i missing...
Replies
18
Views
626
Hello Siemens experts. I am trying to register a GSDML file for an Endress & Hauser's Profinet IO over APL (Profile 4.0) compliant device. TIA...
Replies
2
Views
215
Back
Top Bottom