Author Topic: So very lost...  (Read 1718 times)

Zinopower

  • Newbie
  • *
  • Posts: 7
    • View Profile
So very lost...
« on: February 21, 2016, 06:10:22 PM »
OK, where to begin... First off, long time PLC programmer, first time Visual STudio user.  To say that I am completely overwhelmed by visual studio 2015 is an understatement.  I'm beyond lost.. Holy cow, this is more of a program that I thought.. After taking well over 1 hour and 8 Gigs just to install the program, I am now left utterly lost.  "Solution view"... "team explorer", "Class view", "any cpu", "build solution", "rebuild solution", "add module", "add class", "step into", "step over".. and it goes on and on and on.  I honestly don't have a clue of 1% of this program and.....

So first question, is there a good site, or youtube video training module, where I can get a grasp of the overall visual studio 2015 suite??

Now my other questions are more closer to home for this group... I have several PLC's and a running OPC server.  I've got AHMI installed, and used the quick start to get a simple hmi screen built, with a gauge, and used the OPCDAcom driver, and after many hours finally have it 'talking' to my OPC server.  After working through the signtool.exe missing problem, I now am able to compile it and run it.  It will connect to the OPC server, and it does get the data value for the tag I selected. BUT it seems to have a very very slow update rate, if at all.  The gauge will display the value of the tag when I first run it, and then never seems to update.   Using Matrikon OPC explorer, I can see the value of this tag bouncing around changing every second, but my gauge in AHMI never moves after it first runs...   Almost like its not polling the OPC server for new data ??  Like its a one-shot read??  I've tried to look for settings like "polling rate" "Update rate" etc, to no avail ????

Secondly, Im trying to understand what "synchronizing object" means in the OPCDAcom properties is...  If I dont have it set to the gauge I built, I get no data. But when I add a second gauge, what do I do then?? Do I have to drag another OPCDAcom into the project for each and every gauge, meter etc??

So very glad to have found this program, and looking forward to working with it, but wow, I guess I'm way behind the times...

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: So very lost...
« Reply #1 on: February 21, 2016, 07:33:03 PM »
Visual Studio can be overwhelming the first time working with it. It is a very feature rich environment that does come with some complexity, but understanding a few basic items will allow you to quickly work with it. The top 3 items are Solution Explorer, the Toolbox, and the Properties Window. The Solution Explorer is a tree of all the components that are part of your project (Solution). In AdvancedHMI, the main section you will be dealing with is the first project of AdvancedHMI. The Toolbox contains all of the items that can be added to your form using the visual designer. The Properties Windows lets you set the characteristics of most of true items whether its the form, the objects on the form, or even the items in Solution Explorer.

I don't really have a recommendation for a good tutorial, but the internet is flooded with them since Visual Studio is the world's most popular application development environment.

Starting with an OPC server is adding a fair amount of complexity to your experience. Various OPC Servers work in their own way, so sometimes is it quite challenging to get things working right with OpcDaCom. If there is any chance your PLC can be used with one of the AdvancedHMI native drivers, I highly recommend starting with it. They are much less clunky than an OPC server.

Do not get side tracked with the SynchronizingObject. It will set itself once you add your driver to the form and should be something like Form1. Its a component used to make sure the data on the PLC can send it's value to the UI thread. The drivers usually run on multiple threads.

The PollRateOverride is one that you may have to work with. It is the rate at which data is requested from the PLC. The is typically set to 500ms.

The OpcDaCom works by doing an initial synchronous read. After that it creates a subscription to the OPC Server then sits back and waits for the server to feed it data. If you have a way to view active subscriptions in your server, that would be a good place to start to figure out why the data does not update after the first read.

Zinopower

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: So very lost...
« Reply #2 on: February 21, 2016, 10:42:48 PM »
Thank you Archie!!!! That is reassuring. 

OK, so what I now think is going on, is that the initial read is fine, and I am having DCOM issues with the callbacks....

Using Siemens S7-200 PLC, so no driver.. have to use OPC....

I did run the Matrikon OPC server simulator, and using that, the meter and the gauges are updating great... So I guess I have to figure out DCOM permissions... Which, many years ago, I got into on another application, and I wanted to gouge both my eyeballs out with a rusty ice-pick.....

Perhaps there is a way to do synchronous reads instead of asynchronous and avoid the DCOM callback issues???

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: So very lost...
« Reply #3 on: February 21, 2016, 10:52:24 PM »
Perhaps there is a way to do synchronous reads instead of asynchronous and avoid the DCOM callback issues???
Using only synchronous reads would take a major re-write of OpcDaCom. Besides that I am sure it would work horribly with some OPC servers. I have seen cases where some servers take several hundred ms to respond to a synchronous read. That means refresh cycles on pages with even just 10 values could take several seconds.

See this thread where someone had mentioned the same problem using the Matrikon server:

http://advancedhmi.com/forum/index.php?topic=598.msg5723#msg5723

Zinopower

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: So very lost...
« Reply #4 on: February 22, 2016, 12:51:09 AM »
Ok, got it working!!!!  Had to setup dcom permissions.
Now to learn about visual studio a bit more....

Thanks Archie!!!

Kevin