Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - opmal7

Pages: [1]
1
I am using AdvancedHMI 3.98t with a Micrologix 1100.

I am working with a sensor that outputs a Hex string message.  The message contains multiple pieces of data, using different units for each piece of data.  Some pieces of data are 2 bytes, some pieces of data are 8+ bytes.  In the Micrologix PLC, the entire message gets imported to an integer array.  In RsLogix, if I open the integer array and change the 'Radix' option to "Hex/BCD" then I can see the Hex data that is equal to the message being sent from the sensor.  So, for example, N1:0=AAAA, N1:1=BBBB, N1:2=CCCC, etc.

One of the pieces of information I am interested in is made up of 8 bytes of data, meaning it is spread across 4 consecutive integer values.  For example, N1:0=4151, N1:1=8AFC, N1:2=7FFC, N1:3=BADE.  The actual value I'm interested in is a SP Float with the hex string value "41518AFC7FFCBADE," or a decimal equivalent of "4598769.99."

I currently have the program set up to where I can click a button, and the decimal value is displayed in a text box.  The code for the button press is shown below:

Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click

Dim Value1() As Integer = EthernetIPforSLCMicroCom1.ReadInt("N1:0", 2)
Dim Value1Hex As String = Value1(0).ToString("X4")
Dim Value2() As Integer = EthernetIPforSLCMicroCom1.ReadInt("N1:1", 2)
Dim Value2Hex As String = Value2(0).ToString("X4")
Dim Value3() As Integer = EthernetIPforSLCMicroCom1.ReadInt("N1:2", 2)
Dim Value3Hex As String = Value3(0).ToString("X4")
Dim Value4() As Integer = EthernetIPforSLCMicroCom1.ReadInt("N1:3", 2)
Dim Value4Hex As String = Value4(0).ToString("X4")
Dim Value14digithex As String = Value1Hex.Substring(Value1Hex.Length - 4, 4)
Dim Value24digithex As String = Value2Hex.Substring(Value2Hex.Length - 4, 4)
Dim Value34digithex As String = Value3Hex.Substring(Value3Hex.Length - 4, 4)
Dim Value44digithex As String = Value4Hex.Substring(Value4Hex.Length - 4, 4)
Dim ValueHex As String = Value14digithex & Value24digithex & Value34digithex & Value44digithex
Dim I64 As Int64 = Int64.Parse(ValueHex, Globalization.NumberStyles.HexNumber)
Dim Value As Double = BitConverter.Int64BitsToDouble(I64)
TextBox1.Text = Value.ToString("#.##")

End Sub



This approach has worked so far, but it takes a few seconds for the value to show up in the textbox.  I'm guessing the delay is due to the fact that the program has to read each value from the PLC, and then convert the values into a form that is meaningful (in this case, a decimal value).  I would like to eliminate the button, and have the value continuously update on one of the screens with as minimal delay as possible.  Does anyone have any tips on how to approach this?

2
Support Questions / Program locks up if connection is interrupted
« on: April 17, 2017, 04:42:42 PM »
I'm using a Micrologix 1100 PLC with a tablet running AdvancedHMI 3.98t.

One of the issues that I've run into is that when the tablet screen is locked, the connection to the PLC gets disconnected.  Then when the screen is unlocked, the program locks up, and doesn't appear to be communicating with the PLC anymore.  If I exit the program, and restart it, the program works fine.

I was wondering if there is any way to prevent this from happening.  Or, if there is a way to make a button to re-establish the connection with the PLC.  Then I could make a popup dialog box saying "Connection interrupted, Click OK to re-establish the connection" or something along those lines.  Thanks.

3
Support Questions / Any way to run AdvancedHMI without PLC connection?
« on: December 07, 2016, 11:44:02 PM »
I would like to demonstrate our control software (using AdvancedHMI), and won't have access to our equipment with the PLC.  Is there any way to run the program without a PLC connection?  When I try launching the program, it's very unresponsive, and all the labels read "Failed to get processor type."  I would like to be able to click through the screens, show the screen layouts, and have some "example info" entered into the fields that would normally be filled by PLC values.

4
Support Questions / Integer Data Out of Range
« on: August 15, 2016, 03:36:12 PM »
I'm trying to write a value as an integer to a Micrologix 1100 PLC, using the EthernetIPforSLCMicroCom1 driver.  I'm trying to write the value 35578, and I'm getting an error "unhandled exception" saying that the data is out of range (-32768 to 32767).  Is there any way to do this?

5
Support Questions / Question about using BasicLabels
« on: August 03, 2016, 02:06:16 PM »
I'm using a touchscreen for my HMI, with no keyboard, and the BasicLabel has been great for having user's enter values because of the pop-up keypad.

On one of the screens, I need to add an entry field for the user to enter a decimal number.  This value is not going to be written to the PLC directly, but will need to go through a few programming steps and formatting changes before being sent to the PLC.  Normally, I would just use a regular textbox from the Windows common controls, but that doesn't have a popup keypad when the user clicks on the field.  I tried adding a BasicLabel from the AdvancedHMI controls, but nothing happens when I click on it.

Is that because I don't have anything in the PLCAddress Properties?

Do I need to have a PLC Address entered, in order for the keypad to pop up?

Is there a simple way to have the AdvancedHMI keypad pop up when the user click's on a regular textbox from the common controls?

6
I have a sensor that uses an RS-422 signal that contains multiple data types in the rs-422 message.  The sensor is connected to my Micrologix 1100, and everything is sent and received in hex format.  I'm using an integer array (set to Hex/BCD Radix) to store the incoming and outgoing messages.  One of the pieces of data is in double format, and I have a question about how to get this to work with the AdvancedHMI screen.

I want to add a text box or label where the user can input a number in double format (lets say, 1234.5678).  In hex format this would be (40934A456D5CFAAD).  Then, I need to write this value to the integer array (say N1:1-N1:4).  So in the end, N1:1 will contain 4093, N1:2 - 4A45, N1:3 - 6D5C, N1:4 - FAAD.

Anyone have any tips on how to accomplish this?  Thanks.

7
Support Questions / BasicLabel, Number of Decimal Places
« on: April 14, 2016, 03:32:41 PM »
I'm using a basic label to display a float value from the PLC.  Currently, the label is displaying 5 decimal places.  Is there a way to change it so it only displays 1 decimal place?

Pages: [1]