You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 27th, 2021, 10:34 AM   #16
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,550
Quote:
Originally Posted by Gadelric View Post
The computer communicates with the board via usb.

In the OP the plan was to put in place a dedicated line for the network cable.


So the Visual Studio code is middleware between the relay board (via USB) and the PLC (via network)?


Does the error cause the VS app to crash (so stop running, and needs to be restarted), or does WriteErrorLog(...) write something to the log and also stop the program while it puts up an error dialog box, and someone needs to check [OK] on that error log for the application to continue? I.e. what is the real problem here?

Last edited by drbitboy; January 27th, 2021 at 10:42 AM.
  Reply With Quote
Old January 27th, 2021, 02:44 PM   #17
Gadelric
Member
United States

Gadelric is offline
 
Join Date: Nov 2018
Location: Midwest
Posts: 106
PC runs the VS application, and has a dedicated network leg to the PLC main switch.
The relay board is connected to the PC via USB as well as 2 other usb connected devices.

When the "error" occurs, a message box shows up stating the error, pressing the OK button will close message box.

20% of the time, pressing OK clears the error and the station continues.
80% of the time, the error returns and the PC has to be shut down and the station power cycled and then restart the PC and application.

Error still hasn't returned after the dedicated line was ran to the station, previous set up had this station daisy chaining the network through several stations/switches.

Like was mentioned in this string, we are starting to think this issue has been around forever as a bug in the code, but it wasn't "noticed" until I was able to clear up all the other issues.
This is currently the only issue I have with this assembly line, and big red circles get drawn around the notes about it..


The network leg COULD have solved the problem, but I've seen this issue disappear for several weeks just to spring back up and be the thorn of the day.

At this time, we have exhausted just about every option I can think of, and it is getting to the point the powers that be need to get the developer on the hook for it.
Have to wait to see if/when the issue comes back.

Good times =D
  Reply With Quote
Old January 27th, 2021, 02:59 PM   #18
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,550
It seems unlikely that a different network cable on one "side" of the PC effects a change in the behavior of USB comms on the other side. Perhaps a timing/CPU/resource issue; we've all seen stranger than that.


Another XKCD classic (Hard Reboot; https://xkcd.com/1495/):



  Reply With Quote
Old January 27th, 2021, 03:01 PM   #19
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,550
Can you post the full error message from the log?
  Reply With Quote
Old January 28th, 2021, 11:04 AM   #20
Gadelric
Member
United States

Gadelric is offline
 
Join Date: Nov 2018
Location: Midwest
Posts: 106
Here is the error that is logged.

Error Occured In: Boolean StartRestartSwitch()
System.TimeoutException: The operation has timed out.
at NCD.AD8._Read8BitsValue()
at NCD.AD8.NCD.IAD8.Read8BitsValue(Byte channel)
at Test_Stand.RelayBoard.StartRestartSwitch() in C:\Test Stand\RelayBoard.vb:line 174


When I was troubleshooting this error in the beginning, I ask the developer why are we able to do the test in Manual Mode, but when we switch it back to Auto Mode (PLC Mode) we get the switches error.

The dev replied that in manual mode the system doesn't care what the PLC says, but in auto it does.
It didn't make sense to me, but now that there is a dedicated network cable and the issue has not come back, there could be something related to it.
  Reply With Quote
Old January 28th, 2021, 12:28 PM   #21
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 2,550
Where is this PLC, and how is it related/connected? Is it querying the PC running this VB app? What protocol (Modbus/HTTP/custom API).



I still think the issue is unrelated to the network cable, unless the network connection, especially the daisy chain, is causing the system to hang, and even then the USB hardware should internally complete any communication with the relay board.


A timeout, which this is per the log, would normally be detected by the PC/VB when the relay board did not respond quickly enough. How frequently does the PC query the relay board i.e. how frequently is this StartRestart switch routine called? Is it on demand from the PLC via the network cable? Is it possible to increase the timeout value?


Real-time software like this, which running on a non-real-time platform, needs to be as robust as possible. If several real-time events need to happen, the system should be designed to isolate them so they can be asynchronous as possible e.g. the relay board should be queried at some sustainable rate and the value cached to a memory location, and the code that does that should be independent of the code that handles the network pull from the PLC, which latter code should instead look at the cached location. And all pieces should be able to detect failures and exceptions and recover/reset as gracefully as possible, along with making timestamped logs, both file-based and on-screen, to help diagnose when severe problems occur (e.g. someone knocks a cable loose). It seems like a start has been made along these lines with the Try/Catch and error log.



Caveat: the opinions above makes many assumptions about the process, when I actually know very little about it.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
TwinCAT 3 new Visual Studio versions support CX_Luigi LIVE PLC Questions And Answers 0 August 25th, 2018 04:16 AM
Visual Studio no longer free AustralIan LIVE PLC Questions And Answers 4 January 11th, 2018 09:33 AM
Visual Basic & FactoryTalk View Studio SE Rich Rich LIVE PLC Questions And Answers 3 May 4th, 2011 12:13 PM
Visual Studio NET PLC Drivers fwk LIVE PLC Questions And Answers 3 April 21st, 2009 08:44 AM
Wincc VBscript and visual studio akomazec LIVE PLC Questions And Answers 0 April 6th, 2006 05:21 AM


All times are GMT -4. The time now is 05:15 PM.


.