Rx3i/quickpanel+ VB Script

Start with a value of 65537 in a DINT variable in the PLC. In the PLC, that DINT will use two consecutive %R addresses. If you open a reference view table in PME and look at the %R address, you'll see a value of 1 each of the two %R addresses involved. Now right click on the first %R address, select "Format View Table" and select DWORD as the format. You'll see the value is now 65537. Now write that DINT to the CSV file and see what value you get. If it's 65537, the script wrote a DINT, if it's 1, the script wrote an INT.

I sent Emerson an email and received this as a response.


Look at the registers next to R2429 (i.e. R2430 or R2428). It can be R2429 + R2430 or R2428 + R2429.

These registers are 16bit. System uses 2 of these registers to create a DINT (32bit).

So you have to use 2 registers in the script. Then make a calculation to get the correct value.




So I can't manage that last part that needs to be in the script. is there anyone who can help me with this? So I have the existing script in it, the part:

So you have to use 2 registers in the script. Then make a calculation to get the correct value.

I can create and write the tags that belong in by myself if I have only 1 example sentence/script.
 
You might also try using DINTs without assigning %R addresses to them. It's possible the script has a problem with absolute addressing. %R addresses are 16-bit and the script may assume 16-bit when dealing with variables assigned to %R. With symbolic addressing, the script has to get its information from the variable's type declaration.

I don't have Emerson's latest version of PME. If you can get me a copy of your project in GE's version 9.5 or earlier I can try to make some sense out of it.
 
You might also try using DINTs without assigning %R addresses to them. It's possible the script has a problem with absolute addressing. %R addresses are 16-bit and the script may assume 16-bit when dealing with variables assigned to %R. With symbolic addressing, the script has to get its information from the variable's type declaration.

I don't have Emerson's latest version of PME. If you can get me a copy of your project in GE's version 9.5 or earlier I can try to make some sense out of it.

you mean like here? I changed the dint from 78000 to a dint that became 12464 without an address. as an example. I had tried this before. I only have the 9.8 version. can I reset it to 9.5 somewhere? That's not possible, is it?

2BF35F49-2A42-4DEF-9982-A6EBB6489365.jpeg
 
In that last picture MOVE_INT instruction with a length of 1 copied the lower 16 bits of the DINT at address %R2435&%R2436 to the DINT variable test_no_adress.
What I was suggesting is to create a DINT in the PLC target. Give it a value greater than 65535. Have the HMI target read it and use your script to write it to a CSV file. See if that gets the correct value to the CSV file.
 

So you have to use 2 registers in the script. Then make a calculation to get the correct value.




So I can't manage that last part that needs to be in the script. is there anyone who can help me with this?


VBS script with functions* to convert two 16-bit INTs to a single 32-bit DINT**:
Untitled.png
* Functions Low15 and int16s_to_int32, on the right above
===> the function hilo parses two 16-bit INTs as a pair of space-separated strings from an input line text string

** PowerShell examples on the left, using that script to convert input lines with two INTs into a DINT

  • -1 -1 => -1
  • -1 -150 => -150
  • 1 14464 => 80000
  • 0 32000 => 32000
 
Last edited:
In that last picture MOVE_INT instruction with a length of 1 copied the lower 16 bits of the DINT at address %R2435&%R2436 to the DINT variable test_no_adress.
What I was suggesting is to create a DINT in the PLC target. Give it a value greater than 65535. Have the HMI target read it and use your script to write it to a CSV file. See if that gets the correct value to the CSV file.


I created the tag without an address in the PLC. but how can I put the same tag without an address in the quickpanel (variable list?) because I have to create a tag there and then put it in the script. see picture. can I do that without selecting the address? the tag of the plc is not in my quickpanel variable list.

109F9880-D81E-44F2-8346-D022A7A28193.jpeg 3DCC8FBB-9814-4116-AEC5-5AAF2D34649C.jpeg
 
Create a text object on an HMI screen. Value animate it with the PLC variable. That will create a proxy variable in the HMI variable list. Then you can delete the text object, but the proxy variable will remain in the HMI's variable list.
 
Andor said:
...
View.LogPrintValue LOGFILEHANDLE.Value, prog2.Value, 0
View.LogPrintValue LOGFILEHANDLE.Value, prog3.Value, 0
View.LogPrintValue LOGFILEHANDLE.Value, prog4.Value, 0
View.LogPrintValue LOGFILEHANDLE.Value, prog5.Value, 0
View.LogPrintValue LOGFILEHANDLE.Value, prog6.Value, 0

...


Where do the values for prog1, prog2, prog3, ..., prog6 come from? Is something writing those values into those variables (progN) in the script on the HMI? Do the PLC values from %R02435 and %R02436 end up in prog1 and prog2? or in prog5 and prog6? Or somewhere else?


It may be that two of those progN values are what you need to pass to the int16s_to_int32 function, and then write the return value of that function into the CSV.
 
Create a text object on an HMI screen. Value animate it with the PLC variable. That will create a proxy variable in the HMI variable list. Then you can delete the text object, but the proxy variable will remain in the HMI's variable list.

I've tried it. but as soon as I want to make a download in the HMI, it shows an error 4380. see picture. When I go online with the HMI, I see the value 140000, which is displayed correctly. so that doesn't work either.

68A59381-D3FC-4BFC-BF6D-2C641E237911.jpeg
 
Where do the values for prog1, prog2, prog3, ..., prog6 come from? Is something writing those values into those variables (progN) in the script on the HMI? Do the PLC values from %R02435 and %R02436 end up in prog1 and prog2? or in prog5 and prog6? Or somewhere else?


It may be that two of those progN values are what you need to pass to the int16s_to_int32 function, and then write the return value of that function into the CSV.


the values ​​come from the plc. I read them from the PLC in the HMI.

so far so good. but for the script I have to create an internal tag in the hmi with the same address. that tag is used for the script. I took the two you mentioned as examples. those two addresses belong to O_prog_1 and appear slightly lower in the script. they are both for 1 tag. O_prog_1 (value %R02435 and %R02436) (high and low or vice versa) is that the answer to your question?

What matters to me is that if I have 1 example in the script, I can adjust the rest myself. here below the script of the two values ​​2435 and 2436.

View.LogPrintValue LOGFILEHANDLE.Value, O_Prog_1.Value / 100 , 2
 
How does O_prog_1, which is a single value in the HMI(?), comprise (get created from) %R02435 and %R02436, which are two values from the PLC?


Could you instead get the two 16-bit signed integer values for %R02435 adn %R02436 from the PLC into two integers in the HMI? Then it should be trivial to combine them into a single 32-bit signed integer using VBScript in the HMI.
 
Maybe this will help.
The HMI screenshot shows two different variables, even though they are both looking at the same address in the PLC. The top one displays the variable "HMI_DINT" which looks directly at PLC address %R10.
The bottom one displays the variable PLC.PLC_DINT, whick looks at the PLC variable "PLC_DINT", which is a DINT addressed to %R10 and %R11.

PLC_DINT has a value of 123456.

The PLC and HMI must be targets in the same PME project for this technique to work.
 

Similar Topics

Hi all, I'm trying to setup communications between an RX3i PLC and a GE QuickPanel View touchscreen. I have a CPU315 (IC695CPU315) with an...
Replies
7
Views
4,763
I have a system using Rx3I CRU320 redundant CPU with Proficy Machine Edition Software. In the hardware configuration of each CPU module, under...
Replies
14
Views
389
Hi, we are using Rx3i CRU320 redundant PLC system and we noticed a discrepancy between Primary and Secondary controller. Couple of variables (DI)...
Replies
8
Views
284
Hi there, I'm doing some extensive testing and commissioning with a slew of new Emerson PACSystems RX3i PLCs. It would be convenient to...
Replies
5
Views
106
Hi there, Trying to get some ascii serial communications working via RS485 (COMMREQ functions). I have attached our wiring for the COM2...
Replies
1
Views
976
Back
Top Bottom