M.io

M.io.set_output(i, s)

 

Description: Sets a LUA output state.

Syntax: M.io.set_output(i, s)

Input: i (integer — output number), s (boolean)
Returns: (none)

Supported in MASSO software v5.13 & API Version: 1.0.0

 

 

M.io.get_output(i)

 

Description: Reads a LUA output state.

Syntax: local b = M.io.get_output(i)

Input:  i (integer)
Returns: boolean

Supported in MASSO software v5.13 & API Version: 1.0.0

 

 

M.io.get_input(i)

 

Description: Reads a LUA input state.

Syntax: local b = M.io.get_input(i)

Input: i (integer)
Returns: boolean 

Supported in MASSO software v5.13 & API Version: 1.0.0

 

 

M.io.get_adc(i)

 

Description: Returns ADC?1 or ADC?2 reading.

Syntax: local v = M.io.get_adc(i)

Input: i (integer)
Returns: integer 

Supported in MASSO software v5.13 & API Version: 1.0.0

Example:

-- Read raw ADC value from input channel 1
local raw = M.io.get_adc(1)

-- Convert to volts (12-bit ADC, 0–5 V range)
local volts = (raw / 4095) * 5.0

-- Display both values
message(string.format("Analog Input 1: %d (%.2f V)", raw, volts))

 

WARNING: Input Voltage Range: MASSO G3 analog inputs support a maximum of 5 V DC. Applying voltage above this limit may cause permanent hardware damage.

 

INFORMATION: The ADC operates at 12-bit resolution, returning a value from 0 to 4095 corresponding to 0 V to 5 V DC input.