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 - dhananjay.j@outlook.com

Pages: [1] 2
1
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 19, 2018, 02:05:53 AM »
I am glad it's working for you using SubscriptionDataReceived event, but your case could be similar to this:
https://www.advancedhmi.com/forum/index.php?topic=1823.msg10155#msg10155

What is the "DINTTag" or "dateTime[0]" Mentioned in your Link? Looks like some sort of Connection status strategy to me...

2. You subscribed to multiple Tags with same Callback and the you are sorting data using PLCAddress. I guess thats the catch. I was subscribing to diff tags with individual CallBackHandler. (like CallbackHandlerforB18& CallbackHandlerforF20) etc. which is why None of them were ever called. I'll put same callback for all tags and see what happens but the fact that I cannot have a Different callback for each subscriptionID looks strange.

Archie can we categorize this as a Bug, CallBacks should be called based on either PLCAddress or SubscriptionID. Let me know.

2
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 18, 2018, 10:04:46 AM »
Now I am Testing with following
            Connection.Subscribe("B3:18", 2, 100, CallBackHandlerB18);
Do I hope that I will get B3:18 (0 to 15) and B3:19 (0 to 15) in CallBackHandlerB18 e.values?

update

I am not getting any data in CallBackHandlerB18 ...

When I do this
            Connection.SubscriptionDataReceived += CallBackHandlerB18Global;
I get call to CallBackHandlerB18Global.

Do I use values in e.Values like this?
int valueint1 = Convert.ToUInt16(e.Values[0]);
var value1 = Convert.ToString(valueint1, 2);
int valueint2 = Convert.ToUInt16(e.Values[1]);
var value2 = Convert.ToString(valueint2, 2);
           
then each char is a Tag value?

UPDATE:

Works like Charm....

For Anyone who wants to this sollution then here it is,

do
EthernetIPforSLCMicroCom  Connection = new EthernetIPforSLCMicroCom ();
//Setup Ip
Connection.Subscribe("B3:18", 2, 100, CallBackHandlerB18);
Connection.SubscriptionDataReceived += CallBackHandlerB18Global;

CallBackHandlerB18- Dont bother to implement- never called

public void CallBackHandlerB18Global(object sender, SubscriptionEventArgs e)
        {
            var value1 = Convert.ToString(Convert.ToUInt16(e.Values[0]), 2);//B3:18
            var value2 = Convert.ToString(Convert.ToUInt16(e.Values[1]), 2);// B3:19
            }
        }

Now if you have configured B3:18 0 to 11, like in my case,

Reverse string

public string Reverse( string s )
{
    char[] charArray = s.ToCharArray();
    Array.Reverse( charArray );
    return new string( charArray );
}

then
var newvalue = Reverse(value1);
if(value1.Length!= 11)
{
for(int i = 0;i<11-value1.Length;i++)
{
//Append enough Zeros to make it 11 char in length
newvalue1 += "0";
}
}

do same for B3:19 based on configured Bits (B3:19 0 to 6 7 flags)


 for (int i = 0; i < newvalue1.Length; i++)
            {
                File.AppendAllText("E:/value.txt", $"value of B3:18/{i} is {(newvalue1 == '1').ToString()}" + Environment.NewLine);
            }


 for (int i = 0; i < newvalue2.Length; i++)
            {
                File.AppendAllText("E:/value.txt", $"value of B3:19/{i} is {(newvalue2 == '1').ToString()}" + Environment.NewLine);
            }

If you subscribe to multiple Tags on a Same Connection like
Connection.Subscribe("B3:18", 2, 100, CallBackHandlerB18);
Connection.Subscribe("F20:0", 90, 100, CallBackHandlerF20);
Connection.SubscriptionDataReceived += CallBackHandlerGlobal;

Then Both callbacks will call CallBackHandlerGlobal with e.PLCAddress = "B3:18"/"F20:0". so you can Fetch values accordingly. CallBackHandlerB18 & CallBackHandlerF20 are never called.

And thats all!!!!!!! 8)

Thanks Archie and bachphi for support.

3
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 18, 2018, 06:05:46 AM »
Quote
EthernetIPforSLCMicroCom1.Subscribe("B3:0", 2, 0, AddressOf DataReturned)

Just Checking...
So you say I should use numberOfElements = 2 to get a Word and then Convert the received 2 values to binary 16 bits and get individual flag?(B3:0/1,2,3...15) cause my e.Values(0) =79 while e.Values(1) = 0, so,
79(2) = 01001111 and 0(2)=00000000. Is that right?

4
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 18, 2018, 02:29:09 AM »
How do I subscribe to B Tag Values like I need Some Boolean Values inside  from B3:0 to B3:10(B3:0/0 ,1, 2 to B3:10,0,1,2 etc...)? I get Numeric values in Return in EventErgs. Do I need to Convert them to binary and use as true false?
There is a bug in the current version with subscribing to multiple bits. To workaround it, you need to subscribe to the words (B3:0), then parse out the bits. Within a weeks will be a new beta version that fixes this problem.

Can you give me a example of how to achieve this? When I subscribe to B3:0 and put numberOfElements to some value I get numbers that dont exceed 255(8bit) but  A B3:0 should have 0 to 15(16 bits) so I should only get 1 output till 32766 (signed).  How does this work?

Also, If I am already subscribed to a F tag using Driver Instance do I need to create another instance or subscribing with the same instance should work perfetctly?

5
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 17, 2018, 08:58:10 AM »
I know i may be too much annoying but hopefully this may be the last one


How do I subscribe to B Tag Values like I need Some Boolean Values inside  from B3:0 to B3:10(B3:0/0 ,1, 2 to B3:10,0,1,2 etc...)? I get Numeric values in Return in EventErgs. Do I need to Convert them to binary and use as true false?


Also, Is there a priority to Subscriptions? like if I do
Connection.SubscriptionDataReceived += SubscriptionDataReceivedHandler;
            Connection.DataReceived += DataReceivedHandler;
            Connection.PCCCDataReceived += PCCCDataReceivedHandler;
            var BTagsSubscriptionId = Connection.Subscribe(Tag, 16, 100, CallBackHandlerForB3);

i get value only in PCCCDataReceivedHandler and not even in CallBackHandlerForB3. What will happen in case of multiple subscriptions?

Thanks & Regards,
Dhananjay

6
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 17, 2018, 06:31:30 AM »
What is the TNS value (int type) that we need with Some of the Methods for this Driver(like ClearFault, ChangeMode etc.)?

7
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 17, 2018, 02:55:29 AM »
Is there a free OPC server that we can use to subscribe to all Tags at once? I see OPC dlls with AdvancedHMI Drivers in my project can we use that without any "Other" Application. so that we need to only write tags using AdvanceHMI?

8
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 16, 2018, 12:55:50 AM »
I would say that what you posted looks more like a wishful thinking.

A "solid code example" to me would be an example that I could copy and paste into a project, run it and see what responses come from a PLC.
Minor modifications to that example could be done if necessary.


Yes It's a Wishful Thinking, I called it pseudo code for a reason. Sorry about that.

I guess our main issue is have to be limited to only 1 PLC primarily... I am currently using dictionaries in .net to sync Tags using subscriptions and considering 1s delay for around 230 values subscribed, plus some 40ish individual read writes, which should be enough time to do that. The issue as stated earlier is we have to rely on read failed exceptions to know PLC is busy. We tried put a bottleneck by using C# lock(ThreadLock){ } but still it takes atleast 6 tries some time to read or write a value which is considerable after the number of subscriptions that I have and the explanation that you gave.

Is it allowed to rewrite "EthernetIPforSLCMicroCom" driver code to test some changes? I am thinking of trying to force a thread safety and PLC availability check before push, pull request. If yes, Can we submit it to you so that we may get a feedback from you if it'll work considering PLC limitations/dependencies? will that be Considered as a Chargeable service request?

9
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 15, 2018, 04:04:25 PM »
Archie is the mastermind behind this project, so if anybody can help you then he can.

You should focus on providing the "solid code example so that it can be reproduced for you to test", as you suggested.

All I am currently intersted in 2 things

1.
EthernetIPforSLCMicroCom .SubscribeToAllPLCTags(100sPollrate, CallbackHandler);

void CallbackHandler(obj sender, args e)
{
foreach(var value in e.values)
{
var TagName = value.Address;
var TagValueString = value.Value;
}
}

2. var con = EthernetIPforSLCMicroCom.GetConnection(IPAddress);
if(con.IsConnected)
{}

switch(con.status)
{
case PLCStatus.Offline: con.Connect(); break;
case PLCStatus.Online: return "OK";
case PLCStatus.AvailableToReadWrite: return "Thank God";
.........
}

Is it good enough pseudo code?

10
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 15, 2018, 03:57:12 PM »
Currently we are focusing on completing the project with what works "The Fastest" and fits the BW limitations of PLC. So having a little time to do some Testing, but will definitely post it once I am done here. But those are my observations may be I am right/Wrong.

For the sake of Professionalism, If you (Archie, Team and the viewers) have not found any way to "full scale PLC Tag poll" or "PLC Connection Flags(like Online, Offline, Busy, Available) etc. Please let me know so that I'll stop looking for now...
All our current Indicators are "Read Failed: No Response from PLC" Exceptions (try catch is slowing code like hell), worst case scenario is we do 10 Retries before we give up on a Read Write Operations. That number might have to be increased as complexity increases... And because our client can't afford additional PLCs (We use Micrologix 1400 A...)  right now as we are on tight budget... we have to make due on 1.

Thats the story of a developer... agreed? :D

11
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 15, 2018, 11:58:11 AM »
I have used subscriptions so many major processes in my application are boosted in speed. But there is still a bug(May be) in subscribing to multiple Tags using same instance of EthernetIPforSLCMicroCom. I am working on creating a solid code example so that it can be reproduced for you to test. The primary observation is
1.
EthernetIPforSLCMicroCom  PLCconnection;
PLCconnection.SubscribeToPlcValues("F20:0", 90, 100, CallBackHandler); (C#)
with or without
PLCconnection.SubscriptionDataReceived += DataReceivedHandler (C#)
In some cases "DataReceivedHandler" is called while in others "CallBackHandler" is called. Again I'll put up a code that can reproduce this.
2. Once a "Read failed:No Response" exception occures (With my current PLC this is more frequent) The Polling is stopped and need to re-initiated. (If we can predict if PLC connection is lost or is too busy to respond we can wait and avoid this. But Currently there seems to be no way of doing this. )
3. If more than 1 subscription with single instance of EthernetIPforSLCMicroCom. Only 1 is called(preferably 1st one). Others are ignored. Again Not Confirmed when, will put up code.

 Now the Question remains,
1. Can we do somthing like check if EthernetIPforSLCMicroCom.IsConnected (available to Read and write)? if there is other way to this, its Most welcome...
2. Can we replicate polling like RSLinks receive from PLC. (All Setup tag(F's N's I's, O's, C's etc) values are polled every 100ms)? Cause we definitly need a lot of tags as we have like 10 different cycles running at a time in single PLC consuming Multiple Timers, Counters, PID's and all sort of hardwares values each.

If these 2 things Happen I think you'll have answered Half the PLC world issues :)

Thanks,
Dhananjay

Also anything on this? I thought this is a community forum but all I receive is responses from Archie...
Actually as a user we must have developed many strategies to solve these issues but no one is looking intereseted in sharing one. Thanks Archie.

12
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 15, 2018, 02:44:09 AM »
Also, I usually get "MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException: Read Failed - 240. Error code in EXT STS Byte" and I have implemented a Retry policy for that. I googled alot even got the PLC Exception booklet but there is no specific explaination for this. Can you help me with this as to how to avoid this?

13
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 14, 2018, 05:25:45 AM »
I have used subscriptions so many major processes in my application are boosted in speed. But there is still a bug(May be) in subscribing to multiple Tags using same instance of EthernetIPforSLCMicroCom. I am working on creating a solid code example so that it can be reproduced for you to test. The primary observation is
1.
EthernetIPforSLCMicroCom  PLCconnection;
PLCconnection.SubscribeToPlcValues("F20:0", 90, 100, CallBackHandler); (C#)
with or without
PLCconnection.SubscriptionDataReceived += DataReceivedHandler (C#)
In some cases "DataReceivedHandler" is called while in others "CallBackHandler" is called. Again I'll put up a code that can reproduce this.
2. Once a "Read failed:No Response" exception occures (With my current PLC this is more frequent) The Polling is stopped and need to re-initiated. (If we can predict if PLC connection is lost or is too busy to respond we can wait and avoid this. But Currently there seems to be no way of doing this. )
3. If more than 1 subscription with single instance of EthernetIPforSLCMicroCom. Only 1 is called(preferably 1st one). Others are ignored. Again Not Confirmed when, will put up code.

 Now the Question remains,
1. Can we do somthing like check if EthernetIPforSLCMicroCom.IsConnected (available to Read and write)? if there is other way to this, its Most welcome...
2. Can we replicate polling like RSLinks receive from PLC. (All Setup tag(F's N's I's, O's, C's etc) values are polled every 100ms)? Cause we definitly need a lot of tags as we have like 10 different cycles running at a time in single PLC consuming Multiple Timers, Counters, PID's and all sort of hardwares values each.

If these 2 things Happen I think you'll have answered Half the PLC world issues :)

Thanks,
Dhananjay

14
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 12, 2018, 01:02:48 AM »
Hi Archie,
I am fetching singular values directly by Read method. My requirement here is I want to fetch Timers, Counters & "B" tag values in bulk. I am doing this using subscription for "F" type floating values. eg. I am fetching F20:0 to F20:89 values in a single subscription. Like this If I want to fetch Timer values (like T4:0.ACC to T4:89.ACC, From  T4:0.PRE to T4:89.PRE etc)
Counter values (like C5:0 to C5:89) and boolean bits(B3:0/0 to B3:0/15 etc).
out of these Boolean seems to be giving me error. and returning Numbers like 2,16189 etc if I suscribe to (B3:0,100,100,eventHandler). Do I need to Convert These Values to Binary and then use Bits as true false?.

We work mostly on very complex logical HMI softwares where automation is required and Human interactions are very less. So we don't directly use advanceHMIcontrols but this driver is doing the Magic! Currently my application is working but its very slow due to use of Read and writes which take approx 10ms each (as suggested by you in some other post I read), Following will solve all my issues for all my clients.

Is there a way I can subscribe to PLC Polling to receive all Configured Tags like Rockwell RSLinx Does? If yes, is it a Array of Strings like in case of Subscribe()? If yes, How can I subscribe so that I can separate each tag values (like Convert.ToDouble(e.Values["F20:0"]) C#).

If this is available, then forget my original Question.
If not available, do you suggest /is it Fast enough to subscribe to all Tags individually like ("T4:0.PRE",1,0,eventHandler)?
I can not Thank you enough for doing what you do!

(I am from india, and this is like 10:30 AM here... Hence the Post Timing. I hope you understand)

15
Support Questions / Re: EthernetIPforSLCMicroCom
« on: May 04, 2018, 07:31:34 AM »
Hi, I am on a clock here so any help is good. The connection either causes an error(in case of timers,) or dont call event handler at all.(in case of Counter Tags). in case of booleans it returns next tag values instead of bit values true false.

Update
 Counters and Timers go to oveflow Exception after subscription. while Booleans go to next Tag instead of Bit (B3:1, B3:2 instead of B3:1/0, B3:1/1).

Pages: [1] 2