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.


Topics - busarider29

Pages: [1]
1
Support Questions / Using .NET DataGridView ?
« on: May 11, 2017, 09:19:05 AM »
Greetings,

I want to use a DataGridView control in my application to write to PLC addresses.  The PLC is a SLC-5/05.  I did this for another machine that I wrote a .NET HMI for, but I was not using AHMI and the PLC was a Beckhoff CX2040.  I'd like to mimic what I did on that UI for at least this portion of this UI/HMI.  What is the least painful way to use a DGV to write to PLC addresses in the SLC?  Does AHMI have a ready-made built in control to easily do this?

Attached is a screenshot from the UI that I wrote for the CX2040 where I used a DataGridView control for.  I want to have it so that a user populates the DGV and then clicks a "Write To" button to write the values/entries to the appropriate PLC addresses in the PLC.  That's how the CX2040 UI works, so I would like to make this one like that too. 


2
Support Questions / Deployment?
« on: June 08, 2016, 07:24:40 AM »
I'm going to be using NI (National Instruments) Visual Studio tools in my project with AdvancedHMI, or at least that is my plan right now.  Using NI tools in the project, I am required to build an application using their builder tool and then install the software on the target machine.  Will AdvancedHMI still work by installing it on the target machine as a software application?  I ask this because from my understanding of AdvancedHMI, the "installation" process is simply grabbing the project folder and dropping it somewhere (desktop?) on the target machine?  That method won't work if I have NI tools in the project. 

3
Open Discussion / Reading variables from PLC (Beckhoff)
« on: February 09, 2016, 08:54:42 AM »
This is not related to AdvancedHMI as I am not using it for this particular project that I have.  I need to read variables in the Beckhoff PLC from my .NET application.  I can write to the PLC from my .NET application but I am running into difficulties reading the variables.  I am using Structs to write variables to the PLC and I would like to stick to that convention when reading as well.  I have two thermocouple values that I need to read (iTC1_Val, iTC2_Val) that are in the PLC program.  These are in a Struct in the PLC and the .NET application. 

Thank you in advance for any assistance that can be provided.

'Create Structure in .NET application with the two variables
Code: [Select]
Public Structure ST_PLCAIChannelsINTS
        Public iTC1_Value As Short
        Public iTC2_Value As Short
    End Structure

'Create instance of the Structure, Ads objects for reading/writing, etc.
Code: [Select]
Public Class frmMain
    Private tcClient As TwinCAT.Ads.TcAdsClient
    Private dataStreamWrite As TwinCAT.Ads.AdsStream
    Private dataStreamRead As TwinCAT.Ads.AdsStream
    Private binaryReader As System.IO.BinaryReader
    Private binaryWriter As System.IO.BinaryWriter
    Private plcData6 As ST_PLCAIChannelsINTS

'Create same Struct in the PLC with same name with variables
Code: [Select]
TYPE ST_PLCAIChannelsINTS :
STRUCT
iTC1_Value : INT;
iTC2_Value : INT;
END_STRUCT
END_TYPE

'Create instance of the Struct in MAIN in the PLC
Code: [Select]
PROGRAM MAIN
VAR
st_PLCAIChannelsINTS : ST_PLCAIChannelsINTS;
END_VAR

'Read the PLC variables in this Sub.  This is what I have so far for code.  Is this correct?  What code syntax needs to go in the Try Catch block to perform the actual read?   
Code: [Select]
Private Sub ReadRegisters()
        Dim hvar As Integer
        Dim errorBits As New BitArray(Errors)
        dataStreamRead = New AdsStream(32)
        binaryReader = New BinaryReader(dataStreamRead)
        dataStreamRead.Position = 0

        Try
            hvar = tcClient.CreateVariableHandle("Main.st_PLCAIChannelsINTS.iTC1_Value")
            'Insert code for reading the PLC Struct variables here
        Catch ex As AdsErrorException
            MessageBox.Show(ex.Message, "ADS Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

4
Open Discussion / EtherCAT master "INIT NO_COMM"
« on: January 29, 2016, 01:48:59 PM »
I'm new to TC3 and in the process of commissioning a new machine.  We just got done wiring and power up.  In the EtherCAT master (Device 1 EtherCAT), under the "Online" tab, all the devices show "INIT NO_COMM".  I am using remote IO and using an EK1122 from the main rack to an EK1101 on the secondary rack.  The Run LED on the EK1122 is off, the led status lights on both EtherCAT connections is solid green, so according to Infosys, EtherCAT connections are good (good cable) but no communications on the EtherCAT bus.  That's obvious from my dilemma.  I have the EtherCAT cable running out from X2 on the EK1122 to X1 on the EK1101.  I believe that is correct as well.  I have 24VDC power running to both sets of terminals on the CX2100 (power supply) and the EK1101, so I should have power on the E-bus and power for the terminal I/O. 
It's obvious that I don't have E-bus communications but what is not obvious to me is why??  Any suggestions and what to try, or look for?

5
Open Discussion / Beckhoff wire tag/labeling convention?
« on: January 19, 2016, 04:07:24 PM »
I am new to Beckhoff PLC hardware.  I'm in the process of ordering components and drawing the prints.  I'm looking for norms/conventions that users use for wire labeling to/from the Beckhoff I/O as well as tagging the individual EtherCAT slices.  Beckhoff has a plethora of individual tags that you can purchase that snap onto the I/O slices, but I'm lost as to which ones to get, etc.  For our AB controlled machines, our typical practice is to label the wire to the I/O point as the specific physical I/O (I:02/04, I:02/05, etc...).

6
I am new to Visual Studio and TwinCAT 3.  I have already started on my HMI in VS2012 and have quite a bit of it done and working already (on the HMI side of things).  I want to add the Advanced HMI stuff to my solution but from my understanding, I can't take stuff from the AdvancedHMI solution and drop into my project?  So, what is the way to import my forms and code from my Solution into the AdvancedHMI solution, then rename the solution/project?  Thank you.  By the way, I'm glad I found this site.  A lot of good info and support here for what I'm working on.  Will be helpful in the coming months as I work on this project. 

Pages: [1]