It is currently Thu Apr 24, 2014 10:35 pm




Post new topic Reply to topic  [ 7 posts ] 
 "Write_canceled" problem 
Author Message
Cadet
Cadet

Joined: Tue Oct 19, 2010 12:07 pm
Posts: 9
Location: Montréal, Canada
Post "Write_canceled" problem
I have an OPC error each times I start a "DB to OPC" group. Once I pass this error everything goes as it should.
There's a short explanation of what I'm doing. I'm trying to download in a PLC some value from a work table. This work table is build by a stored procedure. The "DB to OPC" group is triggered when the stored procedure is succesfully completed. Quite simple.
The thing is, each time I start the group to write in the PLC I got an error saying "Write_Canceled" for each tag. It took several seconds before showing this error, letting me think that maybe the execution timed out.
This error occured only once. The group is triggered async, so the second time it's execute, on the same trigger, everything goes normaly without any error. All the next times the group is triggered I don't have any error until the group is stoped and restarted. Also, I'm pretty sure the table builded by the stored procedure is valid for all the executions.
I really wish I can get rid of this start-up error. Hope my explanations are enought clear.
Thanks in advance.
Mio Vaillancourt-Thivierge


Mon Nov 29, 2010 7:24 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 3:43 pm
Posts: 2418
Post Re: "Write_canceled" problem
Perhaps it's possible that the write is failing the first time because the OPC subscription has not fully initialized. This is unlikely, but is the only thing that comes to mind.

What are your trigger settings exactly? Are you only using the "only evalutate this group...(async)" option, or do you have an actual trigger- such as an action item that reads some field from the database?

If you're only using the async mode, it may work better to have a separate trigger table/column in the database that is read by an action item. Then you can execute on change, but use the "prevent trigger caused by group start" option to avoid the first execution.

Regards,

_________________
Colby Clegg
Inductive Automation
Software Development


Tue Nov 30, 2010 4:15 pm
Profile
Cadet
Cadet

Joined: Tue Oct 19, 2010 12:07 pm
Posts: 9
Location: Montréal, Canada
Post Re: "Write_canceled" problem
I'm using the async option and a trigger on an action item. In fact it take a couple of condition before starting this group. More specificaly, an action item is reading a value in the database and an OPC item is confirming that the table use by the group is ready to operate. The trigger is on an other action item who's checking if both condition are good. The table in the database read by the first action item is the same used to write in the PLC and it is the one builded previously by the stored procedure. Can that cause the problem?
I found that if I don't select the "Only execute group once...." option I can write in the PLC but the group is execute three to five times and I still have the startup error.
Is anything else I can try?
Thanks in advance
Mio Vaillancourt-Thivierge


Wed Dec 01, 2010 1:44 pm
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 3:43 pm
Posts: 2418
Post Re: "Write_canceled" problem
Hi,

Could you maybe export the group to CSV and send it to support@inductiveautomation.com, or post it here? I want to be sure that I understand how it is set up. Also, could you go to the Log Viewer and export the errors, so I can see where they're coming from exactly?

Since the errors seem to be related to asynchronous writing, you could try switching it to use the synchronous write method, just to see if that changes anything. You can do that under Settings>Service Settings>OPC Settings.

Regards,

_________________
Colby Clegg
Inductive Automation
Software Development


Wed Dec 01, 2010 2:36 pm
Profile
Cadet
Cadet

Joined: Tue Oct 19, 2010 12:07 pm
Posts: 9
Location: Montréal, Canada
Post Re: "Write_canceled" problem
Hi,
I sure can send you the CSV but you already solve my problem!
As you said, I unchecked the "Use asynchronous writes" option in the services settings and everything seems alright now.
Do you still want the CSV? :wink:
Thanks a lot for your help, as usual you're really efficient.

Mio Vaillancourt-Thivierge


Thu Dec 02, 2010 8:26 am
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 3:43 pm
Posts: 2418
Post Re: "Write_canceled" problem
No, I don't think I need the CSV now, but.... what version of FactorySQL are you using exactly? The writes, even if "async", should block the group and not allow it to run multiple times- I wonder if something is wrong with that.

Regards,

_________________
Colby Clegg
Inductive Automation
Software Development


Thu Dec 02, 2010 1:18 pm
Profile
Cadet
Cadet

Joined: Tue Oct 19, 2010 12:07 pm
Posts: 9
Location: Montréal, Canada
Post Re: "Write_canceled" problem
I'm using version 4.2.11 with Kepware OPC server V5.4.

By the way, is it possible with a DB to OPC block group to use only some column of a table. For example, I would like to use only the "value" column and not the "adress" column of a table. I will choose wich "value" with a specific where clause on the adress but only use the block data item of the "value" in the group. I don't know if you see what I'm trying to do? Is this something possible if the table have the same number of row than the number of item in the block data item?
Hope I'm clear, it's been a long day!
Regards,
Mio Vaillancourt-Thivierge


Thu Dec 02, 2010 1:40 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: