rinstrum M4223 Lua Module User Guide

rinstrum M4223 Lua Module User Guide

rinstrum-lógó

Rinstrum M4223 Lua Module

rinstrum-M4223-Lua-Module-product

If wanting to use the module to complete an Ethernet connection, refer to the M4223/M4223-USER data sheet: M400-629

Sonraíochtaí

  • Ethernet and USB-A & USB-C Ports
  • Embedded Linux Operating System
  • Web Comhéadan
  • Lua 5.1.5
  • LUA Multiplexer (multiple connections to a single R400 device)
  • 64-bit Arm® Cortex®-A53 microprocessor at up to 1.25GHz
  • 512 MB SDRAM, 4GB Flashrinstrum-M4223-Lua-Module-fig-1

Treoracha Úsáide

It is recommended that developers use the Rinstrum 8 I/O tester accessory (A10058) to assist application development.

Rinstrum Documents – available from

https://www.rinstrum.com/all-downloads/

  • Rinstrum Lua Reference Manual (L001-600)
  • Rinstrum Linux Commands (L001-602)
  • Rinstrum Lua Commands (L001-603)

Tagairtí Seachtracha

Connect and Setup
This document will step you through connecting an M4223-USER/M4223-USERHW2 to an R400 indicator, setting up the development environment, and running the “hello world” Lua program stored on the module. As the M4223-USER/M4223-USERHW2 runs a Linux operating system,m you will need some basic Linux commands (L001-602) to navigate the files on the module. Lua Scripts: The Lua module includes example scripts in the /home/lualib_examples directory that show how various functions interact with different parts of the R400 indicator. The /home/lualib_examples/myApp.lua script is an excellent launch point for testing and modifying your own scripts. It is recommended that you keep your scripts in a separate directory under /home/ as a convention (e.g.,/home/myproject/).

Connect M4223 to R420 or R423

  • Disconnect power to the indicator
  • Plug the M4223 into the back of the indicator and tighten the screws to secure the module.
  • Plug an Ethernet cable into the M4223 to connect to your local network (the module is shipped expecting to receive an IP address from your local network’s DHCP). See the Reference Manual for static IP address setup; this is simply configured in the R400 indicator)
  • Cas ar an táscaire

Verify Module Connection on the Indicator and establish its IP address

  • Bring up the Acc (Accessory) menu by holding the 0 key on the alphanumeric keypad.
  • Use the arrow keys to navigate until TYPE displays M4223
  • Press the +/- key until STATUS is shown (should be OK).
    • If the STATUS displayed is ETH.ERR: This indicates the M4223 is not talking to the R400 properly. Check that the M4223 is correctly plugged into the back of the device, turn the device off, wait 10 seconds, and then turn it back on.
  • Press +/- once more so the IP is displayed (referred to as <IP> from here).
    • Use the “.” on the alphanumeric keypad to scroll through the IP address if it is more than 9 characters.
    • If the IP does not change from 0.0.0.0 within at least a minute after start-up, this indicates the module is not getting an IP address. This may be because the Ethernet cable is not plugged in properly or the network is not configured properly.
  • Bring up the Acc (Accessory) menu by holding the 0 key on the alphanumeric keypad.
  • Use the arrow keys to navigate until TYPE displays M4223
  • Press the +/- key until STATUS is shown (should be OK).
    • If the STATUS displayed is ETH.ERR: This indicates the M4223 is not talking to the R400 properly. Check that the M4223 is correctly plugged into the back of the device, turn the device off, wait 10 seconds, and then turn it back on.
  • Press +/- once more so the IP is displayed (referred to as <IP> from here).
    • Use the “.” on the alphanumeric keypad to scroll through the IP address if it is more than 9 characters.
    • If the IP does not change from 0.0.0.0 within at least a minute after start-up, this indicates the module is not getting an IP address. This may be because the Ethernet cable is not plugged in properly or the network is not configured properly.

Windows Environment Setup on your PC

  1. Run Installer: Run .exe file L001-506 to install (https://www.rinstrum.com/all-downloads/)
    • Text editor (Notepad++)
    • FTP client (winSCP)
    • Terminal interface (PuTTY)
  2. Connect to the Module with FTP (WinSCP)

rinstrum-M4223-Lua-Module-fig-2

Click on New Site, select FTP, and enter the IP address of your instrument. Username is root and the password is printed on the module if M4223. If the M4223-USER/ M4223-USERHW2 password must be generated by using rinLIVE. Call the local office to receive login credentials if necessary. rinstrum-M4223-Lua-Module-fig-3Save settings for later use using a convenient name. Now you can navigate to the location of your application files on the PC (left pane) and to the location of your application files on the M4223 (right pane). Synchronise by simply dragging the files in the direction you want them to go.rinstrum-M4223-Lua-Module-fig-4

Log in to the Module using the Remote Terminal Interface (PuTTY)

Open a connection to the module

Windows

  • Open PuTTY
  • Select ‘Telnet’
  • Enter <IP>, leave port as 23
  • Press ‘Open’

Linux

  • Oscail críochfort
  • Type: telnet <IP>

Enter the username and password received from above. Password generated by using rinLIVE if M4223-USERrinstrum-M4223-Lua-Module-fig-5

You are now remotely connected to the M4223 module that is running a Linux operating system. Rinstrum Linux Commands (L001-602) is a simple set of Linux commands (cd to change directory and ls to list files, le haghaidh exampLe)

rinstrum-M4223-Lua-Module-fig-7

The hello world program is stored in the home/examples directory on the M4223 (note Linux is case sensitive and you can use the tab key to auto-complete commands):

  • cd /home
  • cd lualib_examples
  • Lua hello.lua (to run a program)
  • Hello world should display on the R400 indicator screen, along with the weight. Press a key on the indicator to finish.

rinstrum-M4223-Lua-Module-fig-6

Fabhtcheartú

  • ETH.ERR Status: If the indicator shows ‘ETH.ERR’, ensure the M4223 is securely plugged into the device. Power off the device, wait 10 seconds, then power it back on.
  • Dintiúir Logála Isteach: If you do not have login credentials for M4223-USER/M4223-USERHW2, contact your local Rinstrum office to receive them via rinLIVE.

Doiciméid / Acmhainní

PDF thumbnailM4223 Lua Module
User Guide · M4223 Lua Module, M4223, Lua Module

Tagairtí

Cuir Ceist

Use this section to ask about setup, compatibility, troubleshooting, or anything missing from this manual.

Cuir Ceist

Ask about setup, compatibility, troubleshooting, or anything missing from this manual. Name and email are optional.