Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
Technical support / Re: Reading a string using MODBUS RTU
« Last post by garysdickinson on February 25, 2023, 05:04:16 PM »
Lorne,

I pass strings back and forth between Weintek HMIs and TRI PLCs.  Weintek uses arrays of integers to store strings and packs 2 8-bit characters in each 16 bit value. 

This is the code that I use to convert a PLC string variable into an array of registers that can be accessed via Modbus. The HMI reads/writes 16 sequential registers in the PLC to read/write string data. I picked an array size of 16 16-bit integers. This will support strings up to 32 characters.

' Copy Installation Name String from a$ to DM[] so that it can be accessed by the
'   Weintek HMI as an array of 16-bit Modbus registers
'
n = InstallationName    ' starting word in DM[] to build the data for the HMI

' SizeInWords is defined as 16.  16 sequential DM[] locations.
'
for i = 1 to SizeInWords step 2

    ' Two 8-bit ASCII characters are packed into each 16-bit DM value
    '
    ' The Weintek HMI expects strings to be packed into sequential 16-bit words.
    ' The first character in a string is in the LSB of the first word
    '   The second character will be in the MSB of the frist word.
    '
    ' The rest of the bytes are filled with 0x00. This keeps the HMI string object
    '   sane.
    '
    ' Please note that asc() is spec'd to return 0x00 when index is beyond
    '   the end of the string, A$.  It seems to do this in test. This
    '   usage ensures that the entire DM[] array is 0 filled beyond the end
    '   of the string characters.
    '
    DM[n] = asc(A$,i+1) * 256
    DM[n] = DM[n] + asc(A$,i)
    n = n + 1           ' next word in DM[]
next


Gary Dickinson
32
Technical support / Re: Reading a string using MODBUS RTU
« Last post by support on February 24, 2023, 09:09:16 AM »
There is no direct mapping of string variables to Modbus space.

So if you need to read those data, then your program can break up the strings into individual bytes and store them inside the DM space so that they become accessible via Modbus command.
Code: [Select]
A$ = "This is a TEST 1234"

J = LEN(A$)

FOR I = 1 to J
    DM[I] = ASC(A$,I)
NEXT

When you run the above fragment the byte data of each character inside A$ will be stored from DM[1] to DM[J] where J = length of A$

33
Technical support / Reading a string using MODBUS RTU
« Last post by Lorne Van Dusen on February 24, 2023, 07:43:35 AM »
I have a third party device connected to a FX series PLC that uses the MODBUS RTU protical. The developer knows how to read the values of the Inputs, Outputs, Internal Relays as well as the DM values. However is there any way they can read what is stored in say A$?
The A$ will show a 20 character text message such as A$ = "OPEN EMERGENCY STOP " Can anyone tell me how they can read the contents of the A$ using MODBUS RTU commands?
35
News / Release of i-TRiLOGI version 7.52 with HTTPS and MQTT Client Commands
« Last post by Forum Admin on January 23, 2023, 08:35:58 AM »
We are pleased to announce the release of the latest i-TRiLOGI version 7.52 with additional TBASIC commands to support new HTTPS and MQTT client commands available on Wx100 PLC with WiFi, keypad and graphical display (https://triplc.com/wx100.htm).

The new version 7.52 inherits all the user-interface improvement introduced since version 7.4 (see https://triplc.com/smf/index.php/topic,2456.0.html) and can be used for programming the Wx100, Fx2424, Fx1616 and any SmartTILE- based custom-made PLCs. All these new commands can be fully simulated using the i-TRiLOGI built-in simulator.

For more details of the new MQTT and HTTPS TBASIC commands, visit: https://docs.triplc.com/i-trilogi/#tbasic752

For the full i-TRiLOGI Reference Manual, visit: https://docs.triplc.com/i-trilogi/

To upgrade your current i-TRiLOGI, please click on its “Help” menu and select the “TRiLOGI Upgrade” option to visit the download link.


36
General Discussions / Re: Industrial type high performance PLC
« Last post by BetterBath on January 18, 2023, 02:27:57 AM »
The Siemens S7-1500 is a high-performance PLC with support for up to 150 digital inputs and up to 8 analog inputs. It also supports advanced integrated diagnostics, motion control, and integrated communication ports.
fort pierce trash drop offclickjunkremovalgarbagehaulingservicesnearPortSaintLucieFlorida, click hereDisposal services near Port St Lucie, Florida. Click here  for more informationjunk haulers
37
Technical support / Re: Input[1] to Input[5] Operation
« Last post by uknanoman on January 10, 2023, 01:31:55 AM »
Hi
   Thank you support and Gary for looking into this for me. Just before I got this reply I had tried the setsystem 16,1  and yes it made no difference. So as it stands I will keep the remote input data at inputs 81 onwards which seems to work fine.
Regards Peter
38
Technical support / Re: Input[1] to Input[5] Operation
« Last post by support on January 08, 2023, 08:36:30 PM »
Gary suggestions works on the Fx and FMD PLC but unfortunately this won't work on the Wx100 since it uses a different expansion I/O handling system.

Upon power on the Wx100 scans the attached expansion I/O space and mark those expansion I/Os that are available and will only scan those boards during I/O scan. So if a board is not detected upon power on it is not scanned and thus save the I/O scan time automatically.

However, the current Wx100 firm reserves the first 80 digital inputs space and will keep those non available inputs at zero (OFF). It doesn't allow these to be used by the user program. This may change in future firmware revision if there are more users who request such a feature.

 
39
Technical support / Re: Erratic Online Monitoring of I/O Tables with WX100
« Last post by uknanoman on January 06, 2023, 07:32:52 PM »
Hi Support
                Yes thanks for the firmware upgrade, it certainly did stop the erratic behaviour of monitoring, In fact I kept the monitor going for well over an hour without any problems at all. Many thanks
Regards Peter
40
Technical support / Re: Input[1] to Input[5] Operation
« Last post by uknanoman on January 06, 2023, 07:00:29 PM »
Hi Gary
          Thanks for this response. On the face of what you are explaining it would appear that the wx100 must default to set system 16,5 because inputs 81 onwards seem to retain a forced state via the monitor I/o control or as I have found out by using input[6]=dm[10]. In these cases it seems not to be overwritten with a 0. So with your suggestion in mind I will try a set system 16,1 and see how it responds when I get back to work next week. You may be wondering at my thought process regarding storing of (data) at input points. It is simply that because the (data) is data related to physical inputs from a remote i/o block via modbus, I prefer to map them into into an input area of the plc for the clarity of inputs being inputs and subsequently being prefixed with an (i) eg i81 when looking at a ladder diagram. As you have rightly perceived data is after all data whether it is I/O or other my problem is that I can get a bit picky sometimes about how I want that data to appear in the context of the program. Thanks for your input into this post much appreciated, I will let you know how I get on.
Regards Peter
Pages: 1 2 3 [4] 5 6 ... 10