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 - drksam

Pages: [1]
1
Support Questions / Re: modbus values?
« on: January 08, 2016, 12:58:20 PM »
It seems to work i have only tried one but I will let you know if i have problems as more values change.

Thanks again and AWESOME project i cant wait to use it for more.

2
Support Questions / Re: modbus values?
« on: January 08, 2016, 11:40:08 AM »
After poking around in the automationdirect softare I found some conversions it can do to the data and going back to the url I posted I saw that the poster converted his data to BIN. The plc will make that conversion and the again converted output of the AHMI is now correct.

Sorry for all of the confusion and thank you guys for all the help.

3
Support Questions / Re: modbus values?
« on: January 08, 2016, 10:22:49 AM »
I wrote a small program on the automationdirect plc to slowly count up one at a time from 0 to 105 and wrote down the output of the the counter (the real number i want) and of the digital meter (also the same as "data format" decimal in automationdirect software). The pattern kinda looks like binary and not like hex knowing nothing about BCD i assume that the data is in BCD. Example of what i found
1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9     10=16 11=17 12=18 13=19 14=20 15=21 16=22 17=23 18=24 19=25    20=32 21=33 the pattern continues like that so to shorten the list 30=48   40=64   50=80   60=96   70=112   80=128   90=144   100=256

If it is not possible to convert the data is it maybe possible for me to create a table or even a long list of if than statements that could do what i need the system never counts higher than 200 so it could even just go to 200 then say error or something.

4
Support Questions / Re: modbus values?
« on: January 08, 2016, 09:41:25 AM »
Here it is with a little extra just to show where it was

Code: [Select]
  '***************************************
    '* Call backs for returned data
    '***************************************
    Private OriginalText As String

    Private Sub PolledDataReturnedValue(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
        Try
            MyBase.Value = Hex(e.Values(0))
        Catch ex As Exception
            DisplayError("INVALID VALUE RETURNED!" & e.Values(0))
        End Try
    End Sub



    Private Sub DisplaySubscribeError(ByVal sender As Object, ByVal e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
        DisplayError(e.ErrorMessage)
    End Sub

5
Support Questions / Re: modbus values?
« on: January 08, 2016, 09:29:50 AM »
Yes I had to change the name to get it to build after i copied it.

Ok that should be fine its not that i want to see it in hex like 1F4 or something like that. The output im looking for looks like decimal ie. 16 is a normal number for a counter that makes sure a line has between 15 and 17 parts on it. In the automationdirect software it shows it as 16 on the counter and in the v memory location where it is stored for modbus. The automationdirect software lets you change the "data format" when looking at data in a data view thats where i found that the option "BCD/Hex" showed the correct value as 16 (also with other numbers it still dont show data like example 1F4). when i switch the "data format" to decimal i see the same thing that the AHMI shows. i just dont know how to get it to show the original number.

6
Support Questions / Re: modbus values?
« on: January 08, 2016, 08:57:10 AM »
With that code in the existing private sub i get an error building. If i use the private sub from the 4th page of the post you linked and your code it builds fine but it still doesn't change the value on the meter. Also i have tried several other combinations of the code some built some didn't but nothing seems to change the value of the output.  I think I am using the correct one after making a change I have been removing the old test meter rebuilding/building iv tried both then adding a new DigitalPanelMeterHEX.

7
Support Questions / Re: modbus values?
« on: January 08, 2016, 07:36:35 AM »
Ok so i copied PanelMeter and edited it useing the code from that last url in the location that rbelknap gave. I had to play with it to get it to compile but i got it to load. I am pretty sure thats not the right code as it still returned the same value as the DigitalPanelMeter that had not been modified. I have not written much code for anything other than arduino and am lost when looking for a coding solution to do the conversion. I thought i had at some point seen something else on the forum here for converting but after much searching I am yet to find it.

8
Support Questions / Re: modbus values?
« on: January 07, 2016, 08:19:53 PM »
Ok i will give that a try. Just to clarify were you talking about the conversion code on http://advancedhmi.com/forum/index.php?topic=50.0
Also I am using the newest version of visual studio and advanced hmi.

9
Support Questions / Re: modbus values?
« on: January 07, 2016, 03:05:05 PM »
After doing some more reading i find that the WORDs are 16bit each and the manual calls them Holding Registers so i would think that they are longs but still not exactly sure. The automation direct plc has an addressing scheme that takes some getting used to but after playing around i find that the discreet ins and outs work fine i can send a button mash and i see the state of an input.

10
Support Questions / Re: modbus values?
« on: January 07, 2016, 09:56:50 AM »
Well im not really sure. According to the direct soft map they are (WORD)s.

11
Support Questions / modbus values?
« on: January 07, 2016, 09:37:37 AM »
Hi everyone
I have a question about the data being returned to my hmi but first a little background. I have advanced hmi running perfectly connected to an arduino mega with an Ethernet shield. Everything works fine there the values it returns (0 to 50 Amp) are fine and the meters read the same as the serial out on the arduino. The problem comes when I try to talk to an automation direct plc I see the data from the correct register but it is formatted strange. example a value that should be 31 is 49 and a value that should be 16 is 22. In the automation direct software data view i can swap between data types and i see that when it is displayed correctly the data type is (BCD/Hex). I can change that to (Decimal) and i see the same thing Advance HMI is displaying. So i know that it is working properly but i need to be able to display the 31 and the 16 as 31 and 16. I have read around and found the modification to the .vb file that should work but in the version of Advanced HMI that i have line 326 in the panel meter vb file isnt the same as the example. Also it would be nice to be able to just modify one meter not a global meter change as I plan to use one HMI project to display and interface to 3 devices arduino automation direct plc and a delta plc (if possible).

12
Support Questions / MODBUS TCP returning crazy results
« on: May 27, 2014, 01:10:14 PM »
Hi, first i love the software. I am fairly new to the modbus vb world but have been working with ladder logic programs and arduino for years. I have an automation direct DL205-1 plc with a ECOMM100 ethernet card. When i read a value from the plc with AdvancedHMI it does return a value. When the value is a single digit it seems to be ok but with two or more digits it seems to add something together. Perhaps its a DEC VS HEX thing but i have no idea where to look. Also the modbus address for that ethernet card seems to have address values of less than 5 digits for the input and output coils. So i get an error when i try to call or send a value. I have attached a screenshot with a few digital meters and the data view from DirectSOFT to show my problem the modbus address starts at 40769 and is 14 consecutive addresses. The meters are left to right row one then two. The data view is the PLC addresses to the corresponding modbus addresses.

Pages: [1]