Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
Technical support / Re: Reading a string using MODBUS RTU
« Last post by Lorne Van Dusen on February 28, 2023, 11:22:10 AM »
I tried the program from tech support however it only showed a value of 20 in DM[1] which I guess meant 20 characters. Then I tried Gary's and all I got was numbers in DM[1] so something is wrong in both programs.
This is what I need A$ holds a maximum of 20 characters example: A$ = "OPEN EMERG STOP SW  " so if I am correct it would fill 10 consecutive DM's
so on simulation I should see values in DM[1] to DM[10] if there are two BYTES stored in each DM 
32
Technical support / Re: Reading a string using MODBUS RTU
« Last post by support on February 27, 2023, 09:59:16 AM »
Thanks Gary. That is an excellent example of minimizing resources by packing two bytes of ASCII characters into a 16-bit DM instead of 1 DM per byte as per my earlier example.

On the master/client side the program will need to unpack the 16-bit DM values it reads from the PLC and convert each DM to 2-byte string fragment and then concatenate them into a full string. 
33
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
34
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$

35
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?
37
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.


38
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
39
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
40
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.

 
Pages: 1 2 3 [4] 5 6 ... 10