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 - scott.clark

Pages: 1 2 [3]
31
Support Questions / how to post code in a scroll bar window
« on: January 16, 2015, 07:47:32 PM »
How do you post code in a scroll bar window to help cleanup the way the post looks?

32
using AdvancedHMI v3.97c  Visual studio 13

I am seeing these exceptions in my Debug Output Window.  Any suggestions on how to track them down.

A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll

Thanks!

33
Support Questions / ModbusRTU Write special case
« on: January 13, 2015, 04:03:04 PM »
I am working with a ModbusRTU Serial device that isn't quite standard.   This particular device does not allow single registers to be written by the x06 command.  If I execute a write function to a single register, all the drivers that I have tried so far want to use the x06 command for writing to single addresses.  I need a driver that will write to a single register using the x10 command.
 
For example: this is a typical read that works(read single register 0x1000 using command x03):
TX
01 03 10 00 00 01 80 CA   
RX
01 03 02 00 01 79 84
 

This is a typical Write that works(write value of “1” to single register 0x1000 using command x10):
TX
01 10 10 00 00 01 02 00 01 76 51
RX
01 10 10 00 00 01 05 09
 

This is a write that doesn’t work for my ModbusRTU Device(write value of “1” to single register 0x1000 using command x06):
TX
01 06 10 00 00 01 4C CA
RX
01 86 01 83 A0
 
 
So the question is, can your ModbusRTU write command be configured to use the x10 command for writing to single register?  I have allready tested it and it works fine writing to multiple consecutive registers, but I need to be able to write to a single register.

Thanks!

34
Support Questions / Best way to read and write Tags
« on: January 08, 2015, 07:11:18 PM »
using AdvancedHMI 3.97, VS 2013

In this application I am working on I have about 25 tags to display that I could use AdvancedHMI controls on a form.  and I have another 25 to 30 tags that I need to read and write in the background so I can push that data to other devices and routines.  I have tried a number or methods but I can't seem to get an acceptable update rate.  I need to be able to update a few tags in under .5 seconds, operator interface stuff.  Then I have to be able to update, mostly read, about 40 tags some to be displayed and others used to log data.

I used some basic labels and buttons for the operator interface stuff on a EthernetIPforCLXCom_Immediate polling at 250, and then created another EthernetIPforCLXCom_Main (poling at 1000)  for the rest of the tags.  To update the background tags, the ones not to be displayed, I used a DataSubscriber Component being triggered by a tag(plc clock) at a polling rate of 1000.  I used the EthernetIPforCLXCom.read() and EthernetIPforCLXCom().write in the DataSubscriber_changed event.   UPdates are still taking several seconds and appear to be erratic.

I was thinking that the few tags that were on the EthernetIPforCLXCom_Immediate would be able to update, but somehow they are bogged down by the traffic on the EthernetIPforCLXCom_Main .

I am open for suggestions.
Thanks!

I am sure there is a better way.   I can't really group the tags into arrays without a lot of PLC reprogramming, I am trying to interface this with an existing system.  I am open for suggestions.
EthernetIPforCLXCom

35
using AdvancedHMI v3.83

I have been trying to read and write many tags to a plc, but when done in a group such as shown below, an exception will be generated.   I have set the poling rate as long as 5000, but still get the exception.  Ultimately I have about 50 tags to read and write, somewhat infrequently.  I am triggering the event to read and write the tags from a bit in the plc using the DataSubscriber component.


Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged

        g_PLCReadValues.PLCStageCounterValue = EthernetIPforCLXCom_MainForm.Read("StepNumber")
        g_PLCReadValues.MCR = EthernetIPforCLXCom_MainForm.Read("DI_MCRStatus")
        g_PLCReadValues.HipotPass = EthernetIPforCLXCom_MainForm.Read("DI_HiPotPass")
        g_PLCReadValues.HipotFail = EthernetIPforCLXCom_MainForm.Read("DI_HiPotFail")
        g_PLCReadValues.AirPressureSwitch = EthernetIPforCLXCom_MainForm.Read("DI_AirPressureSwitch")
        g_PLCReadValues.RejectPB = EthernetIPforCLXCom_MainForm.Read("DI_RejectResetPB.InDbncd")
        g_PLCReadValues.PLCStageCounterValue = EthernetIPforCLXCom_MainForm.Read("StepNumber")
        g_PLCReadValues.MCR = EthernetIPforCLXCom_MainForm.Read("DI_MCRStatus")
        g_PLCReadValues.HipotPass = EthernetIPforCLXCom_MainForm.Read("DI_HiPotPass")
        g_PLCReadValues.HipotFail = EthernetIPforCLXCom_MainForm.Read("DI_HiPotFail")

        If g_PLCReadValues.RejectPB Then
            btnRejectPBInd.BackColor = System.Drawing.Color.LawnGreen
        Else
            btnRejectPBInd.BackColor = System.Drawing.Color.DarkGray
        End If

    End Sub

Thanks for any suggestions.

36
Using v3.83 and Visual Studio 2013.

How can I gracefully handle loss of ethernet communications with my plc?  When I unplug the ethernet cable, I got this unhandled exception. 

An unhandled exception of type 'System.NullReferenceException' occurred in AdvancedHMIDrivers.dll
Additional information: Object reference not set to an instance of an object.

Ideally, I would like to display a message that communications to the plc have been lost and then clear the message when communications have been reestablished.

Thanks

37
Support Questions / ModbusRTU Serial: writing multiple values
« on: December 23, 2014, 07:00:30 PM »
What is the syntax for writing multiple values with ModbusRTU Serial?  My ModbusRTU device only supports writing to holding registers with the 0x10(16) function code.


38
Support Questions / decoding ModbusRTU serial read result
« on: December 23, 2014, 06:05:54 PM »
So I am reading a group of bits as a word:

strValue1 = ModbusRTUCom1.Read("41281")
lblReadResult.Text = strValue1

The result displayed lblReadResult.Text is "-256"

So what is the binary value of the register "41281"?  It thought it was a signed integer, but I am not sure.
   


39
Support Questions / ModbusRTU Serial extended register addresses
« on: December 23, 2014, 11:43:45 AM »
The modbusRTU device I am working with has some registers in extended address range that I would like to access.

0x6000 to 0x615D
0x7000 to 0x71A8

Does the AdvancedHMIDrivers ModbusRTUCom have a way to access this register address range?

Thanks!

40
The MultiStateSelector SelectedStateBackColor by default is Maroon.  I have tried to select several other colors but get the message "Property Value is not valid"  Details: Value of '357' is not valid for 'green'. 'green' should be greater than or equal to 0 and less than or equal to 255.

How do I change the color?


41
Support Questions / ModbusRTU Serial: reading multiple values
« on: December 10, 2014, 08:01:22 PM »
Ultimately in the application I am working on, I want to read and write to various addresses, but don't need to poll the ModbusRTU device.  So I have tried some of the following code.

'****   This works to read one register ****

        Dim strValue1 As String
        Dim n_strMessage As String

        Try
            strValue1 = ModbusRTUCom1.Read("42817", 1)(0)
            lblReadResult.Text = strValue1

        Catch ex As Exception
            n_strMessage = "Function frmModbusRTUtest: failed with error: " & vbCrLf & ex.Message
            Call ShowMessageBox(clsDisplayMessage.enumDisplayMessageType.Critical, n_strMessage)
        End Try


'****   This code fails to read the multiple registers and generates an exception "No Reponse from PLC. Ensure baud rate is correct."    ****

        Dim strDate As String
        Dim strTime As String
        Dim strValue1 As String
        Dim strValue2 As String
        Dim strValue3 As String
        Dim strValue4 As String
        Dim strValue5 As String
        Dim strValue6 As String
        Dim n_strMessage As String


        Try
            strValue1 = ModbusRTUCom1.Read("42817", 1)(0)
            strValue2 = ModbusRTUCom1.Read("42818", 1)(0)
            strValue3 = ModbusRTUCom1.Read("42819", 1)(0)
            strValue4 = ModbusRTUCom1.Read("42820", 1)(0)
            strValue5 = ModbusRTUCom1.Read("42821", 1)(0)
            strValue6 = ModbusRTUCom1.Read("42822", 1)(0)

            strDate = strValue5 & "-" & strValue4 & "-" & strValue6
            strTime = strValue3 & "-" & strValue2 & "-" & strValue1
            lblReadResult.Text = strDate & "  " & strTime


        Catch ex As Exception
            n_strMessage = "Function frmModbusRTUtest: failed with error: " & vbCrLf & ex.Message
            Call ShowMessageBox(clsDisplayMessage.enumDisplayMessageType.Critical, n_strMessage)
        End Try



It actually worked one time, but has generated the exception all the other times.
Any suggestions???

42
Support Questions / Looking for Example code for using ModbusRTU serial
« on: December 09, 2014, 06:24:22 PM »
I have used the AdvancedHMI for one application and now I have another the needs ModbusRTU serial communications.  I will be interfacing through a USB/serial to RS-485 converter.  HMI will be a Windows 7 64bit machine.   Is there any sample code or setup documentation to guide me through this?

Thanks in advance!

43
Can you develop an AdvancedHMI application on a Windows7 PC and deploy it on an XP machine?

thanks
Scott

Pages: 1 2 [3]