Author Topic: Unstable environment  (Read 4249 times)

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Unstable environment
« on: January 12, 2015, 04:15:34 PM »
I am not 100% if I am the cause of the problems I have been experiencing creating my first project.  I am hoping I am just missing something.  I am attempting a simple project and the vb code Is just breaking.  I am unfamiliar with the feel of visual studio so I am not sure where to start.  I am rusty since I have been using rockwell software for the last few years.  Before that I was only experienced with c++ in a text environment.  I am just trying to get the feel for the environment and I am failing badly.

I had an emulator running a project that I have developed and I have had issues with the driver accessing df1 emulated data.  I sorted that out but everything just fell apart when I created page 2.  It is supposed to be my alarm screen and now I am stuck.  I just don't know the best place to start.  I have had this same issue 3 times and started from scratch.  It is apparent that if I try to ignore basically all my objects disappear.

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #1 on: January 12, 2015, 04:18:25 PM »
I closed the most recent project and had not saved since it failed and I was able to reopen.  If I attempt to rebuild I lose all objects.  Hmmm

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #2 on: January 12, 2015, 04:26:31 PM »
I thought perhaps the errors were related to the page 2 having a DF1Comm1 driver and the first page had the same.  Removing the form change button and the driver from the second page then rebuilding caused studio to crash.  After restarting studio the Main Form works and rebuilding worked.  I am unsure what the real problem is.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Unstable environment
« Reply #3 on: January 12, 2015, 05:08:00 PM »
Visual Studio has a quirk that if you add drivers or controls to the form, then perform a Rebuild, it will crash. You must either perform only a Build, or close all of the forms before doing a Rebuild

doggo

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Unstable environment
« Reply #4 on: January 12, 2015, 06:37:26 PM »
I noticed this one as well...thought it was me at first...Thanks for posting!

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #5 on: January 13, 2015, 08:59:33 AM »
Thank you!

Now, since I am a noob could you help me understand the "building".  When is this necessary and what is the task that is accomplished.  I thought it was as if the system was compling the project but I don't think I am correct because I can run the project without building.  Secondly, when I would deploy a runtime version, would I have a complied project or would the system be running in a client.  I am so unfamiliar with VB, VBA and studio. 

I am just trying to wrap my head around the capabilities before I invest my time into taking a course or dedicating a bunch of time to learning .net and all that goes along with the development.

Again, thanks.

Art

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Unstable environment
« Reply #6 on: January 13, 2015, 09:17:17 AM »
.NET is always compiled before executing. When you click the Run button, the first things Visual Studio will do is compile the necessary code, then run the application. While running in Visual Studio, the application is "hosted" meaning that Visual Studio maintains control of it for debugging purposes.

If you use Windows Explorer to browse the directories, you will find a directory of AdvancedHMI/bin/debug. In this directory is the exe file. This file can be executed outside of Visual Studio.

Generally the "Build->Build Solution" is used to check the program for errors. When you click the Run, the Build action is performed automatically.

The recommended practice for AdvancedHMI is to develop your application in Visual Studio and Run it to test. After completed, copy the entire Solution to the target PC and create a shortcut to the AdvancedHMI\bin\debug\AdvancedHMI.exe file

Since AdvancedHMI or any Visual Studio application is a .NET app, it will require .NET framework installed on the target machine. This is not necessary on your development PC because when you install VS, the framework is also installed.

As a practice, I perform all of the Windows Updates, which includes all of the .NET frameworks.

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Unstable environment
« Reply #7 on: January 13, 2015, 09:27:06 AM »
Archie, can I suggest you to use sticky posts? This information is really usefull for new users who have not worked / worked a little with computer programming languages like a lot of PLC programmers around the world are. Leave basic knowledge for easy access is a way to save time, for everyone. Or the idea of a repository you mentioned, is also good, not only for widgets/code, also for basic knowledge and sharing concepts.

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #8 on: January 13, 2015, 09:41:19 AM »
Ok, another goofy question.  I am not sure but at some point I made the assumption that the software is based on VB.  I am unsure is this is true.  That being said, due to the familiarity that I have with C++; would I be able to make modifications and such to the software if instead of using visual basic at the point of installation I selected C++.  If that sounds at all infantile or useless as a question, I apologize.  I understand I would still be stuck attempting to understand the forms and resources and the rest of the package so it may be minimal at best. 

As an unrelated point of interest, is there a good resource to use to get familiar with the environment.  I literally have experience with unix based command line coding and compiling and high level software like the Rockwell stuff.  All that in-between stuff (like the .net studio) I have never even played with.  I just started fiddling with VBA in excel this month to see if I could view opc tags.  I have looked at tutorials online on VBA, but realistically my questions are more related to navigation an understanding of the system and how it works more that "what can I do".  Most tutorials I have just show the user how to make a button do some task.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Unstable environment
« Reply #9 on: January 13, 2015, 09:50:37 AM »
AdvancedHMI is all based on VB, but the solution structure allows you to add a new project to the solution based on C#. So if you choose to add code to your project, then you can write it in C#. Keep in mind that AdvancedHMI is designed to allow the creation of basic HMIs without the need to write any code. Code writing is only necessary for functionality that doesn't exist within the pre-built components.

On the main AdvancedHMI web site under the news section is a link to a series of VB tutorials. These will help get familiar with Visual Studio.

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #10 on: January 13, 2015, 01:06:58 PM »
A first chance exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in AdvancedHMIDrivers.dll

This is what started me chasing my tail yesterday.  Then the crashes started.  Now I am not rebuilding just building if the environment tells me to.
I am back to this error.  The exact same driver on page 1 works 100%

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Unstable environment
« Reply #11 on: January 13, 2015, 01:36:20 PM »
What version are you using and what driver are you using? Are you reading with code or just putting a PLCAddress in an existing control?

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #12 on: January 13, 2015, 01:56:28 PM »
Currently I am using v396 with the df1comm driver because I am emulating for the current development.  I am just placing the plc in a basic label for now.

I saw that there was a new release.  I would grab that and use it but once again my unfamiliarity with studio leaves me unsure.

I do not know what I would need to copy to allow me to continue with the work I have started.  I downloaded the basic label manual but it didn't help me with the problem because it seems to be a comm driver issue?  I am simply using built in commands for the first project.  It is a simple mode selection screen with pid input values.  There is a button to open form 2 which is the alarm screen. 

I need to show a string value for each alarm, and the associated value and status bits.  I will make a grouped object with all the info and then copy the object.  I would like to be able to pass a parameter to each one instead of updating 10 tags for each object since the structure in the plc is the same for all with a different start register.  I have not gotten past the string!  The string will display on page 1 but page two ...no dice.

example alarm 0 (alarm xx would be st31:xx, and data starts at n1xx:0)
st30:0 = alarm 1 information
n100:0/0 = input condition
n100:0/1 = alarm timeout
n100:0/3 = alarm acknowledged
n100:2 = alarm time month
n100:3 = alarm time day
n100:4 = alarm time hour
n100:5 = alarm time min
n100:6 = alarm time sec

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Unstable environment
« Reply #13 on: January 13, 2015, 02:09:46 PM »
There was another report with a problem with DF1Com driver.  I will set up later today to see if I can replicate.

The DF1 driver tends to get very little attention and testing because the demand has dropped quite significantly. The Ethernet drivers tend to get the most attention and sometimes the DF1 is left broken.

aduhaime2003

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Unstable environment
« Reply #14 on: January 13, 2015, 02:13:36 PM »
I do not really need it for anything more than test.  I will try the plc. I have a few downstairs on some equipment being assembled.  I will see if I have better results for the time being.  I do make a lot of projects via the emulator.  I suppose that I could use rslinx.  I just had no clue how to get into that since I didn't know what the server name was and where to find the name of it on the pc.  I fiddled with it but gave up because I saw that using the df1 with emulator looked easy.