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.


Messages - FlockaFlame

Pages: [1]
1
Support Questions / BeginWriteRaw() Max Byte Limit?
« on: January 24, 2023, 04:29:25 PM »
I am wondering if there is a max limit to how many bytes you can use on this function (or does it depend on PLC or something else?). I am currently trying to write 50000 bytes of information in one go and nothing seems to happen when I do this.
When I write 1000 bytes of information with BeginWriteRaw(), this is successful and takes about 100ms to visually see on PLC side.

2
I found a solution, but not figured what the problem was. The version was not of the matter. For some reason, there isn't enough time given to "write" to the PLC. If I add a Thread.Sleep(>200) after using BeginWriteRaw(...), the write will always be successful.

If no Thread.Sleep(...) is used, the BeginWriteRaw will very likely make an exception/error of
"System.NullReferenceException: Object reference not set to an instance of an object."

3
I am using "AdvancedHMIv399xR1"

4
Support Questions / AdvancedHMI C# BeginWriteRaw and WriteRaw Error Help
« on: November 10, 2022, 04:11:59 PM »
I am currently running 2 parallel tasks every 1 second or 3 seconds.
One to read/write heartbeat comms to say we're connected (writes to a DINT which is 4 bytes) and another one that does calculations and writes a UDT to PLC (916 bytes worth of UDT info).

In the startup of my program, it's likely to get the following error:
"System.NullReferenceException: Object reference not set to an instance of an object"
    at MfgControl.AdvancedHMI.Drivers.CIP.CIPforCLX.a(CLXAddress A_0, Int64 A_1, Int32 A_2)
    at MfgControl.AdvancedHMI.Drivers.CIP.CIPforCLX.a(CLXAddress A_0, UInt16 A_1, Byte[] A_2, Int32 A_3, Int64 A_4)
    at MfgControl.AdvancedHMI.Drivers.EthernetIPforCLX.BeginWriteRaw(String startAddress, Int32 numberOfElements, Byte[] dataToWrite)
This only occurs when trying to BeginWriteRaw() or WriteRaw() to PLC (never a problem with connecting to PLC).
If I try/catch this in an infinite loop, it will eventually not error out and write every time, but after a while, it will miss a write here and there and be good for a while again.

Anyone know the possible cause for this or any ideas?

Pages: [1]