Programmatically update scaling values


#1

I have a application where I am reading the 4 to 20 mA value from a pressure transducer. I am looking for the most efficient way to re-calibrate the unit in the field. If I enter the scaling values in the unit when I am creating the strategy, will it be possible to create an application to change these values in the field? I am using Labview and modbus communications to gather the information from the PAC-R1 with a running strategy. I would like to add a calibration routine to my Labview program. I need to be able to have the calibration values stored in the PAC because this give me the flexability to change computers or HMI’s connected to it.

Terry


#2

Hi Terry
I have not used this but just a suggestion, have you tried to write to the memmap location of the transducers scaling? ie: if you inspect a device via PAC Manager and then select Point Config you should be able see the memmap address for the upper and lower scaled units. Check the image below:


this shows module 3 point 0 from a PAC-R2. you can see the memmap address to change the upper scaled units is 0xF0109014 and for the lower its 0xF0109018. You should be able to use WriteNumber to I/O Unit Memory Map to execute the new scaling.
ie: result = WriteNumToIoUnitMemMap(pac_r1, 0x0xF0109014 , myUpperScaledVar);

I hope this helps
Regards
Nick Stephens

FWIW i have used the WriteNumToIoUnitMemMap command to successfully change the IP address of the ENET interfaces on a PAC controller. Probably not recommended but lets say you have a system with an R controller that has static IP’s. what if you ‘sold’ this system to someone who wanted to put on their internal network (or what if the client changes their network config)? A change, store and reboot can all be done from writing to mem map locations. I believe this command can be a very powerful tool if used correctly.


#3

Thanks Nick for the suggestion. I am able to read and write to the Unit MemMap by writing to the Modbus registers. For example to change the offset value of Analog Point 0 of Module 0, I write a value to Unit ID 10, Address 7.

Now my questions is what would be the command to save the values to flash (PAC Managers command is Store configuration to flash)?

Regards

Terry.


#4

Hi Terry,
Form 1465 is your friend for all things memory map. Look under “operation codes” about sending a 3 to address F038000. Be very careful when writing to flash in your program – if you accidentally put this in a loop and write over and over you could wear out that flash!
-OptoMary


#5

Thanks OptoMary. However I am a bit confused with the differences between the addressing of the OptoMMP and Modbus. To this point I have been using the handy modbus calculator in PAC Manager. I copy the the address (F010000C converts to UnitID 10 and Register 7). This has been working for me. Now with I enter F0380000 I get a UnitID 30 and Register 1. What am not sure about is value to enter to this location? When I read more in modbus form #1678 it shows that saving the configuration to flash at register 1026 and to write any none zero values to the two 16 bit registers. But this does not tell me the UnitId to write to. What Unitid and register should I be using and what is the format of the value being entered?

Regards

Terry.


#6

Hi Terry,

I just tried it w/my R1 (using a little software utility called Modscan32). I used the default “Device Id” of 1, and the register 1026 as mentioned in form 1678 as you pointed out. I just wrote an integer of 1 since it said any non-zero was okay, and that did the trick! My saved values were still there when I rebooted.

I’ll let the doc people know that form 1678 could be a bit more clear on that point. Thanks for asking!

-OptoMary


#7

Hi OptoMary,

Having the correct UnitId did the trick. It would be nice if there was some clearer discriptions for the UnitID’s as they seem to change depending on the function you are performing, i.e. Point config is 10, Analog Point is 21, Serial Module is 31. This of course is if I use the OptoMMP address and convert to modbus.

What I find confusing is Form #1678 seems to use different addresses to get to all the same information.

Thanks

Terry