-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is the CODE #2
Comments
You have to call AddTag before using it. See the example
|
Thank for the update, now I added the code and getting error saying PLCTAG-ERROR-TIMEOUT
Same tag works file when I call directly using PLC tag rw program.
…Sent from my iPhone
On Sep 9, 2017, at 2:31 PM, Michele Cattafesta ***@***.***> wrote:
You have to call AddTag before using it. See the example
'''
client.AddTag(tag);
/* let the connect succeed we hope */
while (client.GetStatus(tag) == Libplctag.PLCTAG_STATUS_PENDING)
{
Thread.Sleep(100);
}
'''
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
You should use this Tag constructor and adapt it to Plc5 |
Still getting the same error.
…Sent from my iPhone
On Sep 9, 2017, at 3:17 PM, Michele Cattafesta ***@***.***> wrote:
You should use this Tag constructor.
var tag = new Tag("192.168.0.100", CpuType.SLC, "B3:0", DataType.Int16, 1);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Any update I am connecting PLC 5.
…Sent from my iPhone
On Sep 9, 2017, at 3:17 PM, Michele Cattafesta ***@***.***> wrote:
You should use this Tag constructor.
var tag = new Tag("192.168.0.100", CpuType.SLC, "B3:0", DataType.Int16, 1);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Can you post the updated code ? |
Hi there,
Finally I was able to resolve all my network issues etc and able to get the data out.
One question, how we read string data.
Regards,
Rishi
…Sent from my iPhone
On Sep 10, 2017, at 11:36 AM, ***@***.*** wrote:
Any update I am connecting PLC 5.
Sent from my iPhone
> On Sep 9, 2017, at 3:17 PM, Michele Cattafesta ***@***.***> wrote:
>
> You should use this Tag constructor.
> var tag = new Tag("192.168.0.100", CpuType.SLC, "B3:0", DataType.Int16, 1);
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
|
I forgot to push the example. |
Thanks for the update, it's working fine for me now.
Any idea if I can get all the available tags list out from PLC?
Regards,
Rishi
…On Thu, Sep 21, 2017 at 4:25 PM, Michele Cattafesta < ***@***.***> wrote:
I forgot to push the example.
Check it here:
https://github.com/mesta1/libplctag-csharp/blob/master/
Slc500Strings/Program.cs
You can read maximum 1 string per request, so don't try to increase the
element count, it will not work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcQv8CYPlGx1ELdNKme6hVJD3g3DBoVrks5sksYugaJpZM4PSE82>
.
|
Hi, i am trying to communicate with AB Micro820. It showing error in reading Tag. Created Tag as follows: Thanks. |
I just wanted to say thank you for your youtube video and having this be open source. This is super helpful. |
Hi, Thanks For Your Efforts |
This is the I am calling from client:
The ReadTag method is giving error:
An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in mscorlib.dll
}
public class PlcTag: IDisposable
{
private readonly Dictionary<string, IntPtr> _tags;
public PlcTag()
{
_tags = new Dictionary<string, IntPtr>();
}
public int ReadTag(Tag tag, int timeout)
{
var result = plc_tag_read(_tags[tag.UniqueKey], timeout);
return result;
}
[DllImport("plctag.dll", EntryPoint = "plc_tag_read", CallingConvention = CallingConvention.Cdecl)]
static extern int plc_tag_read(IntPtr tag, int timeout);
}
The text was updated successfully, but these errors were encountered: