# Update the M2 SAL Interface Based on the Latest XML File in Phase 2

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Story Points:
3
• Sprint:
TSSW Sprint - Oct 26 - Nov 9, TSSW Sprint - Nov 9 - Nov 23
• Team:
Telescope and Site
• Urgent?:
No

#### Description

Update the M2 SAL interface based on the latest xml file. After the summit test at Feb. in this year, the M2 xml has been updated to support more use cases than before. This task is to update the software to support this.

The main focus is in this task is the state machine transition and figure out how to let the M2 to be controllable by SAL.

This task is in the phase 2.

#### Attachments

1. enterControl.png
274 kB
2. enterStandbyState.png
11 kB
3. T14900-0124 - LSST M2 Controller ICD_revB.pdf
469 kB

#### Activity

Hide
Te-Wei Tsai added a comment - - edited

Based on the m2ms_incomingSAL.vi, there should be a user event (SAL_Command) to decide the M2 control system can accept the SAL command or not. In the case structure inside, a enum of SAL_InterfaceCommandEnum.ctl is used.

The PublishOnlySubstate class has the systemReady.vi to send the SAL_Command event to allow the SAL command. This is triggered by the exec.vi of SystemReady class.

The createCommand.vi in CommandFactory class issues the SystemReady command. There is a SystemNotReady command as well.

Show
Te-Wei Tsai added a comment - - edited Based on the m2ms_incomingSAL.vi , there should be a user event (SAL_Command) to decide the M2 control system can accept the SAL command or not. In the case structure inside, a enum of SAL_InterfaceCommandEnum.ctl  is used. The PublishOnlySubstate class has the systemReady.vi to send the SAL_Command event to allow the SAL command. This is triggered by the exec.vi of SystemReady class. The createCommand.vi in CommandFactory class issues the SystemReady command. There is a SystemNotReady command as well. The SystemMonitor class has the check_for_system_ready.vi to send the SystemReady command.
Hide
Te-Wei Tsai added a comment - - edited

I got the system to be AvailableStateSubstate and then, back to the PublishOnlySubstate state. Maybe this is because of the TMA communication error:

 2020-11-06T11:21:26.167-07:00,System state change to OfflineState 2020-11-06T11:21:26.167-07:00,System substate change to AvailableStateSubstate 2020-11-06T11:21:26.168-07:00,(WARNING) (E6086) Loss of TMA comm 2020-11-06T11:28:38.462-07:00,System state change to OfflineState 2020-11-06T11:28:38.462-07:00,System substate change to PublishOnlySubstate 

It looks like this OfflineState is just because I press the "Quit GUI" button. But I do see the value of "pass/block command" changes from False to True to False. Need to check this. In addition, may need to update the method to flush the SysLog message.

Show
Te-Wei Tsai added a comment - - edited I got the system to be AvailableStateSubstate and then, back to the  PublishOnlySubstate state. Maybe this is because of the TMA communication error: 2020 - 11 -06T11: 21 : 26.167 - 07 : 00 ,System state change to OfflineState 2020 - 11 -06T11: 21 : 26.167 - 07 : 00 ,System substate change to AvailableStateSubstate 2020 - 11 -06T11: 21 : 26.168 - 07 : 00 ,(WARNING) (E6086) Loss of TMA comm 2020 - 11 -06T11: 28 : 38.462 - 07 : 00 ,System state change to OfflineState 2020 - 11 -06T11: 28 : 38.462 - 07 : 00 ,System substate change to PublishOnlySubstate It looks like this OfflineState is just because I press the "Quit GUI" button. But I do see the value of "pass/block command" changes from False to True to False. Need to check this. In addition, may need to update the method to flush the SysLog message.
Hide
Te-Wei Tsai added a comment - - edited

Based on T14900-0124 - LSST M2 Controller ICD_revB.pdf, the LSST state machine should have been implemented.

I could enter the StandbyState (by SAL) by manually overwriting the enableCommand flag:

The start command to DisabledState will fail because the powers are off. I may need to test this on simulator or hardware on summit.

Finally, I could enter the StandbyState by the SAL without the manual override:

The system log message is:

 2020-11-09T14:11:46.705-07:00,System state change to OfflineState 2020-11-09T14:11:46.705-07:00,System substate change to AvailableStateSubstate 2020-11-09T14:11:46.706-07:00,(WARNING) (E6086) Loss of TMA comm 2020-11-09T14:12:07.416-07:00,System state change to StandbyState 

Show
Te-Wei Tsai added a comment - - edited Based on T14900-0124 - LSST M2 Controller ICD_revB.pdf , the LSST state machine should have been implemented. I could enter the StandbyState  (by SAL) by manually overwriting the enableCommand flag: The start command to DisabledState will fail because the powers are off. I may need to test this on simulator or hardware on summit. Finally, I could enter the StandbyState by the SAL without the manual override: The system log message is: 2020 - 11 -09T14: 11 : 46.705 - 07 : 00 ,System state change to OfflineState 2020 - 11 -09T14: 11 : 46.705 - 07 : 00 ,System substate change to AvailableStateSubstate 2020 - 11 -09T14: 11 : 46.706 - 07 : 00 ,(WARNING) (E6086) Loss of TMA comm 2020 - 11 -09T14: 12 : 07.416 - 07 : 00 ,System state change to StandbyState
Hide
Te-Wei Tsai added a comment -

I would like to check the heartbeat event, acknowledge command, and logging of file tomorrow.

Show
Te-Wei Tsai added a comment - I would like to check the heartbeat event, acknowledge command, and logging of file tomorrow.
Hide
Te-Wei Tsai added a comment - - edited

Used the log.json to replace the SysLog.xml and TelemetryLog.xml and updated the related code. Refactored the functions of Log.lvclass. Added the unit tests.

Show
Te-Wei Tsai added a comment - - edited Used the log.json to replace the SysLog.xml and TelemetryLog.xml and updated the related code. Refactored the functions of Log.lvclass . Added the unit tests.
Hide
Te-Wei Tsai added a comment -

https://github.com/lsst-ts/ts_mtm2/pull/23

In this PR, I did the following:

• Remove the ConfigFiles/ in project.
• Fix the bugs in m2ms_incomingSAL.vi to allow the pass of SAL commands.
• Use the config/log.json to replace the SysLog.xml and TelemetryLog.xml.
• Refactor the functions in Log class and reflush the log message at each time of new entry.

Thanks!

Show
Te-Wei Tsai added a comment - Please help to review the PR: https://github.com/lsst-ts/ts_mtm2/pull/23 In this PR, I did the following: Remove the ConfigFiles/  in project. Fix the bugs in m2ms_incomingSAL.vi to allow the pass of SAL commands. Use the config/log.json  to replace the SysLog.xml  and TelemetryLog.xml . Refactor the functions in Log class and reflush the log message at each time of new entry. Thanks!
Hide
Dave Mills added a comment -

Great work on unit tests!

Show
Dave Mills added a comment - Great work on unit tests!

#### People

Assignee:
Te-Wei Tsai
Reporter:
Te-Wei Tsai
Reviewers:
Dave Mills
Watchers:
Dave Mills, Te-Wei Tsai
0 Vote for this issue
Watchers:
2 Start watching this issue

#### Dates

Created:
Updated:
Resolved:
Start date:
End date:

#### Jenkins

No builds found.