GX developer: multiplication before sending value on AO card...

Mas01

Member
Join Date
Oct 2020
Location
Leicester, England
Posts
1,109
I've got a Q68DAIN (Mitsubishi Q series analogue output module). On the HMI, Basically on the screen, the user types in a value as a percentage (0-90) and this opens the water valve by the same amount. Basically, I want to multiply D620 (the value typed) by 47 before sending it out on the AO module.
I've tried doing the multiplication on the HMI (gt designer3) as a little script...the multiplication works and D620 is multiplied correctly, BUT it also multiplies the on-screen angular value by 47 which is clearly not what I want.
I prefer to do the multiplication in the code if possible...I just think it's cleaner like that... I'm not keen on "embedding" code in the HMI if it can be avoided.
Can anyone suggest what the code update should be?
Thanks

IMG_20220202_093000.jpg
 
Last edited:
Thanks, but when I press f4 to complie the change in get an error.message "The program before correction differs from the registered program <ES:010a4070> "

Any idea why I'm getting this?
 
Last edited:
Update....F4 works fine for code updates on MAIN, but I only get the error in the ANALOGUE window (where I'm.making the change). I'm confused.
 
Last edited:
This is the error message I get in the ANALOGUE nL window when I try to compile using F4.

Strangely, F4 works fine in the MAIN window.

IMG_20220202_115507.jpg
 
It appears that the code in the analogue program differs from the original in the PLC, this happens if for some reason it did not match before you modified it, every time you compile a program it date stamps it or creates a checksum, so when you try to make an on-line change it says the original date stamp or checksum for the on-line & off line did not match.
The best thing you can do is go back to the original code (presumably you have a copy or undo the changes i.e. do not save, do a compare & see what the difference is, when you correct it & add the extra code you will have to download the program it will not let you do an on-line change, there are a number of scenarios that cause this, a change at some point was done on-line but you failed to save the changes on the PC, a change & compile was done but not downloaded.
Things to remember, first before making changes compare your file with the program in the PLC before making any changes, ensure you have a backup of the code before you do any mods (important if you have not done any mods in the last few days i.e. gone back after a weekend).
One other reason it will not do an on-line change is if the changes are larger than the on-line change settings regarding memory shifting or there are calls to subroutines you have modified, then you have to do a compile & download in stop mode.

The compare function will only show the differences as mnemonic code i.e. list mode so not ideal & could show a lot of addresses after an extra contact has been inserted as it compares actual address locations & adding just one contact shifts all the others down.
Assuming the code running in the PLC is working ok you could upload it to your file as you are in ladder mode (cannot do this in a structured project unless the symbolic information has been downloaded to the PLC), but if it sends all the comments out (line comments) then you will have a project that does not make sense.
I suggest you do a compare of that block & post the differences here perhaps could see what has happened.
 
Here is an example where a ladder project with multiple program blocks differ when compared file against PLC, you can see there is an extra contact in the file that does not exist in the PLC.

Compare.png
 
Operation function

You can also use operation function of hmi entry.
in the write value multiply by 47.
and in monitor value divide bu 47.

I think it is neat solution without doing anything in ladder program.

Capture.PNG
 

Similar Topics

I'm trying to verify a project with a PLC. The Transfer Setup menu item is grayed out and every time I click Verify with PLC, I get an error...
Replies
1
Views
53
Well, I've decided to start a new project, and like all projects, it has already gone horribly wrong. I purchased a PLC device (supposedly a...
Replies
2
Views
113
Does anybody have any samples of how to "Create and Use" UDT's in CCW Developer Edition? (I am using v22) I can't find any information from...
Replies
3
Views
315
I'm trying to manually convert a Beijer E200 HMI project onto to a new Mitsubishi GOT gs2107-wtbd. The PLC is a very old A-series AS1CPU and is...
Replies
1
Views
383
Hi One of the PLC's that I maintain/update is a Mitsubishi Q-Series, probably installed about 10 years ago. At the moment, ALL the wires from...
Replies
13
Views
1,172
Back
Top Bottom