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 - qwideman

Pages: [1]
1
I'd like to run a subroutine whenever my PLC connection causes an error. I'm using Modbus TCP/IP.

I have tried:
 
Sub Comm_error(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ModbusTcpCom.ComError
Msgbox...etc
End Sub

This does not execute, even if I set ModbusTcpComm to an address other than my PLC.


How should I be doing this?

Quinton
Rolan Inc.

2
I am getting an error at:
Transactions(e.TransactionNumber And 255) "Index was outside the bounds of the array."
Code: [Select]
   If Transactions(e.TransactionNumber And 255) IsNot Nothing Then
            Transactions(e.TransactionNumber).ErrorReturned = True
        Else
            MsgBox(e.ErrorMessage)
        End If
in ModbusTcpipComm.vb

What does this mean? This is on a form with 1 ModbusTcpipComm object, 2 DataSubscribers, 12 AdvancedHMI Controls and a picturebox.

EDIT: Each pipe has a property set to "PLC" which is what I named the "ModbusTcpComm1"...  There are a lot of pipes, but less than 50. Are these interfering? I can't change the CommComponent for a pipe without it reverting automatically...

Any help would be much appreciated.

Quinton Wideman

3
I'm getting the following error: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created."at line 612 of ModbusTcpComm and I haven't been able to get rid of it. I am trying to monitor the PLC using a "backgroundworker" component on a  form that I want to keep minimized most of the time. However, that form should show a progressbar to indicate that the program is running. There may be a better approach for what I am trying to do, I'm open.

Regardless, I would like to know what I did wrong.
I got rid of unnecessary parts, and now I have just one form, with a ModbusTcpComm component (PLC), and a Background worker on it.



' I added the following code at the bottom of MainForm.vb. Notice that this contains an "End Class", which replaces the one that's there.   

Code: [Select]

 Dim asd As New secondclass

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
        BackgroundWorker1.RunWorkerAsync()
    End Sub

    Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
        MsgBox(asd.readPLC(40100))
    End Sub
End Class

Public Class secondclass
    Public Function readPLC(ByVal address As UInteger)
        Return MainForm.PLC.Read(address)
    End Function
End Class

Any help would be much appreciated!

Thanks,
Quinton Wideman
Rolan Inc

4
Support Questions / NullReferenceException when switching Forms
« on: September 09, 2013, 09:14:15 AM »
I have a NullReferenceException error, so I made a smaller program to try to isolate the problem , but I'm still not sure.

I have 2 forms, each has a tank control. They read 2 different addresses on the same PLC using 2 ModbusTCPComm driver instances, 1 for each form.
When I open the second form, using the form change button I get an error at line 553 of ModbusTCPComm: Object reference not set to an instance of an object.


How can I fix this?

Thank you,

Quinton Wideman
Rolan Inc.

5
Support Questions / Properties: HighlightColor and HighlightKeyCharacter?
« on: September 04, 2013, 10:42:09 AM »
How can I use the pipe component's properties: HighlightColor and HighlightKeyCharacter either in advanced HMI or with code?

Quinton

6
Feature Request / Request a MODBUS over RS232 driver
« on: August 29, 2013, 11:13:33 AM »
Please consider a MODBUS over RS232 driver for standalone applications.


(I have been using the TCP/IP driver everywhere I can, and it works great! I'm not a fan of drivers that are specific to one particular brand of device.)

Thanks.

Quinton Wideman
Rolan Inc.
rolaninc.ca

7
Hi,

What would it take for a gauge control to read 0.00 - 1.00 in response to a PLC input that varies from 0 - 100? That is, I want the gauge to display 1/100 of the integer from the PLC. Right now, I can't set Gauge.MaxValue to 1.

Thank you,


Quinton Wideman
Rolan Inc

8
Feature Request / Component to allow logging to .CSV
« on: August 07, 2013, 05:43:01 PM »
Could a module be made that would contain the history of a data register by sampling it at regular intervals, much like "sampling" on most HMI platforms?
Could a module be made to display a graph of the data from the sampling channel?
Could a module be made to export the sampled data in .CSV format?

I'm not capable of coding this myself at this point. If these can be done, as well as support for email alerts and Multiple Modbus TCP/IP connections: I would be quite interested. If needed, I can probably pay for some of these features...


Thank you,

Quinton Wideman
Rolan Inc.
rolaninc.ca

9
Feature Request / Connection to multiple devices on Modbus TCP/IP
« on: August 07, 2013, 05:35:17 PM »
I don't know very much VB at all. What would be required to make it possible to connect multiple Modbus Devices over Modbus TCP/IP? For example, having 2 pilot lamps addressed to separate PLCs.

Could a module be made that would support this?

I don't think I can write that code.  ;D


Thank you,

Quinton Wideman
Rolan Inc.
rolaninc.ca

10
Feature Request / Email Alert
« on: August 07, 2013, 05:26:18 PM »
I don't know very much VB at all. What would be involved in configuring email alerts triggered by a data value going out of a preset range, or by a bit set high?

 Has this been done? Would someone help me with the code - or is it available with a price?

Thank you,

Quinton Wideman
Rolan Inc.
rolaninc.ca

Pages: [1]