AdvancedHMI Software
General Category => Support Questions => Topic started by: EE_Kraig on March 14, 2017, 01:51:54 PM
-
I get errors whenever I try to get this to work. I want to be able to enter (and display) minutes on a DPM keypad but write milliseconds to the PLC. So if I type in 1, I need to write 60000 to the PLC. If 60000 is in the PLC, display 1 on the DPM. Can I do this with the DPM settings?
-
What did you try and what errors are you getting?
You should be able to just put 0.00001677 in both ValueScaleFactor and KeypadScaleFactor
-
What did you try and what errors are you getting?
You should be able to just put 0.00001677 in both ValueScaleFactor and KeypadScaleFactor
OK did that and I get "Failed to write value. Input string was not in a correct format." One thing I noticed, whatever I enter into the keypad has to be a factor of the scale value. Example, If I put 0.6 and enter 5, 7, 10, etc I get the above error.
Why do the scale factors appear to be backwards? If I put 0.1 in KeypadScaleFactor, and enter a 1, I get 10 in PLC. Maybe there is a good reason for this.
-
I just tried this out in the latest version and I'm not getting any error.
In most cases ValueScaleFactor and KeypadScaleFactor are going to be the same because the value from the PLC is multiplied by the ValueScaleFactor. When writing through the keypad, the entered value is divided by the KaypadScaleFactor.
-
Visual Studio 2013 shows the error that EE_Kraig mentioned.
It is possible to switch "/" with "*" and use 60000 as KeypadScaleFactor, then it works (approximately line 368 inside the DigitalPanelMeter.vb):
m_ComComponent.Write(m_PLCAddressKeypad, CDbl(KeypadPopUp.Value) * m_KeypadScaleFactor)
-
Visual Studio 2013 shows the error that EE_Kraig mentioned.
It is possible to switch "/" with "*" and use 60000 as KeypadScaleFactor, then it works (approximately line 368 inside the DigitalPanelMeter.vb):
m_ComComponent.Write(m_PLCAddressKeypad, CDbl(KeypadPopUp.Value) * m_KeypadScaleFactor
I'll try that, may work better for me. Thanks!
-
Just unzipped latest version, dropped a DPM and used the same settings as you, error.
-
Visual Studio 2013 shows the error that EE_Kraig mentioned.
It is possible to switch "/" with "*" and use 60000 as KeypadScaleFactor, then it works (approximately line 368 inside the DigitalPanelMeter.vb):
m_ComComponent.Write(m_PLCAddressKeypad, CDbl(KeypadPopUp.Value) * m_KeypadScaleFactor)
Thanks again! KeypadScaleFactor = 60000 and ValueScaleFactor = 0.0001667 works perfectly.
-
I have been able to replicate, but only by writing to a 16 bit integer. When it converted 1 to 60000, it overflowed the integer and threw that exception. Are you writing to a DINT or INT?
-
I have been able to replicate, but only by writing to a 16 bit integer. When it converted 1 to 60000, it overflowed the integer and threw that exception. Are you writing to a DINT or INT?
The register in my PLC is a UDINT but if I try to enter anything in the DPM larger than 2147483647 (scale factor = 1) I get this error:
"Failed to write value. Value is either too large or too small for an Int32."
-
When it comes to writing, the driver does not distinguish a UDINT from a DINT, so when you exceed the limit of a DINT value, that is causing the error.
-
I made a driver patch for V3.99w that you can try:
https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Patches
-
Archie,
But when I make the modification that Godra suggested in DigitalPanelMeter.vb, it works splendid and I actually prefer it that way I wouldn't mind switching the ValueScaleFactor to a divide. So what does the patch do? It would maybe be handy to be able to do either a divide or multiply scale.
-
The patch makes it write a UDINT correctly