AdvancedHMI Software
General Category => Support Questions => Topic started by: sramirez on July 21, 2023, 08:02:57 AM
-
I have a tag that I am trying to read with AdvancedHMIDrivers.EthernetIPforCLXCom. It is a valid tag but I get the error "The path is not of a legal form".
Here is the crazy thing, it was working and then I did a Build in VS2019 and started getting this error.
I thought I had a corrupted Visual Studio project file so I created a new project and copied the code over to the new project. The .Read(tagname) command worked for a while. I did multiple builds and after a few hours the new project stopped working with the "The path is not of a legal form" error. I have no idea what to do.
Any guidance would be great.
-
I don't have a crystal ball, a little more info would be helpful, copy the code or screenshot...
May be checking for an extra space in the path.
-
I have a tag that I am trying to read with AdvancedHMIDrivers.EthernetIPforCLXCom. It is a valid tag but I get the error "The path is not of a legal form".
Is that the exact error? I tried searching the error list in AdvabcedHMI, and do not find that. A more common error is "Path Segment Error"
-
The code is as follows
Dim _EthernetCommsMain As New AdvancedHMIDrivers.EthernetIPforCLXCom
With _EthernetCommsMain
.IPAddress = IPAddress
.PollRateOverride = 1000
.ProcessorSlot = 0
End With
Dim val as string = _EthernetCommsMain.Read("RFID_Security.AOI_RFID.To_App_Reset_Request") <--- Error happens on this line.
The path to the tag is valid. I have tested this path with another application to make sure it was valid.
The error returned by VS2019 is attached.
Thanks for any assistance.
"The path is not of a legal form" is the exact error message I receive.
I am running AdvancedHMIv3.9.9.25.38
-
Can you scroll the error to the right so I can see the end of the Stack Trace
-
Is '.To_App_Reset_Request' a custom string?
Is 'RFID_Security' UDT a Safety class or Standard? and is it set for External Access= Read/Write?
I may see a problem here: 'RFID_Security' is a UDT. Normally we can have another UDT below it, but it appears in this case, that 'AOI_RFID' is an AOI, not a sub UDT, hence their tags are local access.
Can you export the UDT and AOI, I can test it out.
-
That error sounds more like a visual studio thing rather than something coming from the driver.
sramirez, if you change it to read a simple DINT, does it produce the same error?
-
Thank you for the responses.
RFID_Security.AOI_RFID.To_App_Reset_Request is a BOOL type
Here is the entire stack trace
at MfgControl.AdvancedHMI.Drivers.EthernetIPforCLX.BeginRead(String startAddress, Int32 numberOfElements)
at MfgControl.AdvancedHMI.Drivers.EthernetIPforCLX.Read(String startAddress, Int32 numberOfElements)
at MfgControl.AdvancedHMI.Drivers.DriverBase.Read(String startAddress)
at hdPLC.uiPLC.ReadProgramTag(String ProgramName, String Tag) in C:\git\Framework\FrameWork_Libraries\hdPLC\uiPLC.vb:line 235
I have attached the UDT for bachphi.
I would agree it appears to be a VS2019 thing because I can run the exact same block of code in another application and it works fine. I just have no idea where to go from here!
-
I believe I found the source of the problem but it makes no sense to me.
If I run my application in debug mode with a command line parameter I get the error.
If I don't run a command line parameter the path passed to .Read() works as expected.
Example:
RemakePart.exe 17165 in debug mode, Dim val as string = _EthernetCommsMain.Read("RFID_Security.AOI_RFID.To_App_Reset_Request") produces the error.
RemakePart.exe in debug mode - no error, read PLC's path and returns the expected value.
Open CMD.exe and run RemakePart.exe 17165 from the same bits/folder - works as expected.
I am not sure what to make of this but I wanted to share what I found.
Thanks,
Shawn R