Jump to content

Component: MIAC GSM (MIAC: Addon Modules): Difference between revisions

From Flowcode Help
No edit summary
No edit summary
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_ma_gsm.fcfx FC_Comp_Source_ma_gsm.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ma_gsm.fcfx FC_Comp_Source_ma_gsm.fcfx]


==Detailed description==
==Detailed description==




Line 30: Line 32:


==Examples==
==Examples==




Line 42: Line 46:


==Macro reference==
==Macro reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SetStart'''
|-
| colspan="2" | Sets the state of the GSM module Start pin. (Low level GSM interface) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_CheckNetworkStatus'''
|-
| colspan="2" | Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SendScript'''
|-
| colspan="2" | Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | idx
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SendTextMessage'''
|-
| colspan="2" | Sends the text message data specified to the number specified using the SMS protocol. Returns 0 for success and 255 for failure. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Number
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Message
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SendCommand'''
|-
| colspan="2" | Sends a command string to the GSM module. 0 = Command sent ok, 255 = No Reply 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Command
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SendCR
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_GetCharCount'''
|-
| colspan="2" | Returns the number of characters waiting to be read from the receive buffer. (Low level GSM interface)  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_CheckForIncoming'''
|-
| colspan="2" | Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_SetData'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D0
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D1
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D2
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D3
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D4
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | D5
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_Init'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_HangUpCall'''
|-
| colspan="2" | Ends a voice based call. Returns 0 for success and 255 for failure. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_GetData'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Index
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SetReset'''
|-
| colspan="2" | Sets the state of the GSM module Reset pin. State = 0 will hold the module in the reset state (Low level GSM interface) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_DialNumber'''
|-
| colspan="2" | Performs a standard voice call by dialling the number specified. Returns 0 for call in progress and 255 for no response. 
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Number
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_StringReceive'''
|-
| colspan="2" | Attempts to receive a string from the GSM modem. Returns 1 if successful, 0 on timeout 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_Message'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CMD_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_WR'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CMD_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Count
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | Start
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:]] -
| width="90%" | More
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LED_Control'''
|-
| colspan="2" | Sets the indicator LED On (State=1) or Off (State=0) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_AnswerIncomingCall'''
|-
| colspan="2" | Answers the phone for an incoming type call. Returns 0 for success and 255 for failure. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SetRTS'''
|-
| colspan="2" | Sets the state of the GSM module RTS pin. (Low level GSM interface) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | State
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_PushData'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Data
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_Initialize'''
|-
| colspan="2" | Resets and restarts the GSM module Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_SendCharacter'''
|-
| colspan="2" | Sends the byte character to the GSM module. (Low level GSM interface)  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Byte
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_ReadString'''
|-
| colspan="2" | Copies the data from the data string array to a local string variable 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumBytes
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DigitalOutput'''
|-
| colspan="2" | Set a Terminal Output to High (Value=1) or Low (Value=0) 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Value
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_GetTextString'''
|-
| colspan="2" | Collects the text message data from an incoming text message. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumBytes
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''MIAC_Module_GetAck'''
|-
| colspan="2" |  
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CAN_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CMD_ID
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | TimeOut
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_GetStatus'''
|-
| colspan="2" | Returns status bits from the GSM module. Bit 6 = CTS, Bit 12 = STATUS (LED), Bit 13 = RING (Low level GSM interface)  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AnalogInput'''
|-
| colspan="2" | Read the ADC value of a Terminal Returns 12 bit ADC reading 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" | Terminal number to be read 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_GetTextNumber'''
|-
| colspan="2" | Collects the sender's phone number from an incoming text message. 
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | NumBytes
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DigitalInput'''
|-
| colspan="2" | Read the value of a terminal  
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Terminal
|-
| colspan="2" |  
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GSM_GetCharacter'''
|-
| colspan="2" | Returns the next character waiting to be read from the receive buffer. (Low level GSM interface)  
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
==Property reference==
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Module Type
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Module Address
|-
| colspan="2" |  
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Script Count
|-
| colspan="2" | Maximum number of scripts to store in the device's ROM 
|-
| width="10%" align="center" | [[File:Fc9-type-11-icon.png]]
| width="90%" | Script1
|-
| colspan="2" | ASCII based AT command data stored in ROM and used when sending script 1 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Expect Echo
|-
| colspan="2" |  
|}==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 15:18, 20 January 2023

Author
Version 1.0
Category MIAC: Addon Modules


MIAC GSM component

GSM Addon for MIAC System.

Component Source Code

Please click here to view the component source code (Beta): FC_Comp_Source_ma_gsm.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

GSM_SetStart
Sets the state of the GSM module Start pin. (Low level GSM interface) 
- BYTE State
 
- VOID Return


GSM_CheckNetworkStatus
Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. 
- BYTE Return


GSM_SendScript
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. 
- BYTE idx
 
- BYTE Return


GSM_SendTextMessage
Sends the text message data specified to the number specified using the SMS protocol. Returns 0 for success and 255 for failure. 
- STRING Number
 
- STRING Message
 
- BYTE Return


GSM_SendCommand
Sends a command string to the GSM module. 0 = Command sent ok, 255 = No Reply 
- STRING Command
 
- BYTE SendCR
 
- BYTE Return


GSM_GetCharCount
Returns the number of characters waiting to be read from the receive buffer. (Low level GSM interface)  
- BYTE Return


GSM_CheckForIncoming
Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing 
- BYTE Return


MIAC_Module_SetData
 
- BYTE Count
 
- BYTE D0
 
- BYTE D1
 
- BYTE D2
 
- BYTE D3
 
- BYTE D4
 
- BYTE D5
 
- VOID Return


MIAC_Module_Init
 
- UINT CAN_ID
 
- VOID Return


GSM_HangUpCall
Ends a voice based call. Returns 0 for success and 255 for failure. 
- BYTE Return


MIAC_Module_GetData
 
- BYTE Index
 
- BYTE Return


GSM_SetReset
Sets the state of the GSM module Reset pin. State = 0 will hold the module in the reset state (Low level GSM interface) 
- BYTE State
 
- VOID Return


GSM_DialNumber
Performs a standard voice call by dialling the number specified. Returns 0 for call in progress and 255 for no response. 
- STRING Number
 
- BYTE Return


GSM_StringReceive
Attempts to receive a string from the GSM modem. Returns 1 if successful, 0 on timeout 
- BYTE Return


MIAC_Module_Message
 
- UINT CAN_ID
 
- UINT CMD_ID
 
- BYTE Return


MIAC_Module_WR
 
- UINT CAN_ID
 
- UINT CMD_ID
 
[[File:]] - Count
 
[[File:]] - Start
 
[[File:]] - More
 
- VOID Return


LED_Control
Sets the indicator LED On (State=1) or Off (State=0) 
- BYTE State
 
- VOID Return


GSM_AnswerIncomingCall
Answers the phone for an incoming type call. Returns 0 for success and 255 for failure. 
- BYTE Return


GSM_SetRTS
Sets the state of the GSM module RTS pin. (Low level GSM interface) 
- BYTE State
 
- VOID Return


MIAC_Module_PushData
 
- BYTE Data
 
- VOID Return


GSM_Initialize
Resets and restarts the GSM module Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
- BYTE Return


GSM_SendCharacter
Sends the byte character to the GSM module. (Low level GSM interface)  
- BYTE Byte
 
- VOID Return


GSM_ReadString
Copies the data from the data string array to a local string variable 
- BYTE NumBytes
 
- STRING Return


DigitalOutput
Set a Terminal Output to High (Value=1) or Low (Value=0) 
- BYTE Terminal
 
- BYTE Value
 
- BYTE Return


GSM_GetTextString
Collects the text message data from an incoming text message. 
- BYTE NumBytes
 
- STRING Return


MIAC_Module_GetAck
 
- UINT CAN_ID
 
- UINT CMD_ID
 
- UINT TimeOut
 
- BYTE Return


GSM_GetStatus
Returns status bits from the GSM module. Bit 6 = CTS, Bit 12 = STATUS (LED), Bit 13 = RING (Low level GSM interface)  
- UINT Return


AnalogInput
Read the ADC value of a Terminal Returns 12 bit ADC reading 
- BYTE Terminal
Terminal number to be read 
- UINT Return


GSM_GetTextNumber
Collects the sender's phone number from an incoming text message. 
- BYTE NumBytes
 
- STRING Return


DigitalInput
Read the value of a terminal  
- BYTE Terminal
 
- BYTE Return


GSM_GetCharacter
Returns the next character waiting to be read from the receive buffer. (Low level GSM interface)  
- BYTE Return



Property reference

Properties
Module Type
 
Module Address
 
Script Count
Maximum number of scripts to store in the device's ROM 
Script1
ASCII based AT command data stored in ROM and used when sending script 1 
Expect Echo
 

==Macro reference==

GSM_SetStart
Sets the state of the GSM module Start pin. (Low level GSM interface) 
- BYTE State
 
- VOID Return


GSM_CheckNetworkStatus
Returns the state of the GSM network. 0 = Not connected, 1 = connected, 255 = no reply from GSM. 
- BYTE Return


GSM_SendScript
Send an AT command script. Returns 0 for fail, 1 for success and 255 for unrecognised script idx. 
- BYTE idx
 
- BYTE Return


GSM_SendTextMessage
Sends the text message data specified to the number specified using the SMS protocol. Returns 0 for success and 255 for failure. 
- STRING Number
 
- STRING Message
 
- BYTE Return


GSM_SendCommand
Sends a command string to the GSM module. 0 = Command sent ok, 255 = No Reply 
- STRING Command
 
- BYTE SendCR
 
- BYTE Return


GSM_GetCharCount
Returns the number of characters waiting to be read from the receive buffer. (Low level GSM interface)  
- BYTE Return


GSM_CheckForIncoming
Checks to see if any incoming phone call or SMS message. 0 = Nothing, 1 = Text Received, 2 = Phone Ringing 
- BYTE Return


MIAC_Module_SetData
 
- BYTE Count
 
- BYTE D0
 
- BYTE D1
 
- BYTE D2
 
- BYTE D3
 
- BYTE D4
 
- BYTE D5
 
- VOID Return


MIAC_Module_Init
 
- UINT CAN_ID
 
- VOID Return


GSM_HangUpCall
Ends a voice based call. Returns 0 for success and 255 for failure. 
- BYTE Return


MIAC_Module_GetData
 
- BYTE Index
 
- BYTE Return


GSM_SetReset
Sets the state of the GSM module Reset pin. State = 0 will hold the module in the reset state (Low level GSM interface) 
- BYTE State
 
- VOID Return


GSM_DialNumber
Performs a standard voice call by dialling the number specified. Returns 0 for call in progress and 255 for no response. 
- STRING Number
 
- BYTE Return


GSM_StringReceive
Attempts to receive a string from the GSM modem. Returns 1 if successful, 0 on timeout 
- BYTE Return


MIAC_Module_Message
 
- UINT CAN_ID
 
- UINT CMD_ID
 
- BYTE Return


MIAC_Module_WR
 
- UINT CAN_ID
 
- UINT CMD_ID
 
[[File:]] - Count
 
[[File:]] - Start
 
[[File:]] - More
 
- VOID Return


LED_Control
Sets the indicator LED On (State=1) or Off (State=0) 
- BYTE State
 
- VOID Return


GSM_AnswerIncomingCall
Answers the phone for an incoming type call. Returns 0 for success and 255 for failure. 
- BYTE Return


GSM_SetRTS
Sets the state of the GSM module RTS pin. (Low level GSM interface) 
- BYTE State
 
- VOID Return


MIAC_Module_PushData
 
- BYTE Data
 
- VOID Return


GSM_Initialize
Resets and restarts the GSM module Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
- BYTE Return


GSM_SendCharacter
Sends the byte character to the GSM module. (Low level GSM interface)  
- BYTE Byte
 
- VOID Return


GSM_ReadString
Copies the data from the data string array to a local string variable 
- BYTE NumBytes
 
- STRING Return


DigitalOutput
Set a Terminal Output to High (Value=1) or Low (Value=0) 
- BYTE Terminal
 
- BYTE Value
 
- BYTE Return


GSM_GetTextString
Collects the text message data from an incoming text message. 
- BYTE NumBytes
 
- STRING Return


MIAC_Module_GetAck
 
- UINT CAN_ID
 
- UINT CMD_ID
 
- UINT TimeOut
 
- BYTE Return


GSM_GetStatus
Returns status bits from the GSM module. Bit 6 = CTS, Bit 12 = STATUS (LED), Bit 13 = RING (Low level GSM interface)  
- UINT Return


AnalogInput
Read the ADC value of a Terminal Returns 12 bit ADC reading 
- BYTE Terminal
Terminal number to be read 
- UINT Return


GSM_GetTextNumber
Collects the sender's phone number from an incoming text message. 
- BYTE NumBytes
 
- STRING Return


DigitalInput
Read the value of a terminal  
- BYTE Terminal
 
- BYTE Return


GSM_GetCharacter
Returns the next character waiting to be read from the receive buffer. (Low level GSM interface)  
- BYTE Return



Property reference

Properties
Module Type
 
Module Address
 
Script Count
Maximum number of scripts to store in the device's ROM 
Script1
ASCII based AT command data stored in ROM and used when sending script 1 
Expect Echo