M1M3 Support System
Loading...
Searching...
No Matches
ILCMessageFactory.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Vera C. Rubin Telescope and Site System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef ILCMESSAGEFACTORY_H_
25#define ILCMESSAGEFACTORY_H_
26
27#include <ILCApplicationSettings.h>
28#include <ModbusBuffer.h>
29#include <cRIO/DataTypes.h>
30
31namespace LSST {
32namespace M1M3 {
33namespace SS {
34
36
37class ILCMessageFactory {
38public:
39 ILCMessageFactory();
40
41 void reportServerID(ModbusBuffer *buffer, uint8_t address);
42
50 void reportServerStatus(ModbusBuffer *buffer, uint8_t address);
51 void changeILCMode(ModbusBuffer *buffer, uint8_t address, uint16_t mode);
52 void reportILCMode(ModbusBuffer *buffer, uint8_t address);
53 void broadcastStepMotor(ModbusBuffer *buffer, uint8_t broadcastCounter, int8_t *steps);
54 void unicastStepMotor(ModbusBuffer *buffer, uint8_t address, int8_t steps);
55 void electromechanicalForceAndStatus(ModbusBuffer *buffer, uint8_t address);
56 void broadcastElectromechanicalFreezeSensorValues(ModbusBuffer *buffer, uint8_t broadcastCounter);
57 void broadcastPneumaticFreezeSensorValues(ModbusBuffer *buffer, uint8_t broadcastCounter);
58 void setBoostValveDCAGains(ModbusBuffer *buffer, uint8_t address, float primaryGain, float secondaryGain);
59 void readBoostValveDCAGains(ModbusBuffer *buffer, uint8_t address);
60 void broadcastForceDemand(ModbusBuffer *buffer, uint8_t broadcastCounter, uint8_t boosterValves,
61 int32_t *saaPrimarySetpoint, int32_t *daaPrimarySetpoint,
62 int32_t *daaSecondarySetpoint);
63 void unicastForceDemand(ModbusBuffer *buffer, uint8_t address, uint8_t boosterValve,
64 int32_t primarySetpoint, int32_t secondarySetpoint);
65 void unicastSingleAxisForceDemand(ModbusBuffer *buffer, uint8_t address, uint8_t boosterValve,
66 int32_t primarySetpoint);
67 void unicastDualAxisForceDemand(ModbusBuffer *buffer, uint8_t address, uint8_t boosterValve,
68 int32_t primarySetpoint, int32_t secondarySetpoint);
69
77 void pneumaticForceStatus(ModbusBuffer *buffer, uint8_t address);
78 void setADCScanRate(ModbusBuffer *buffer, uint8_t address, uint8_t rate);
79 void reportADCScanRate(ModbusBuffer *buffer, uint8_t address);
80 void setADCChannelOffsetAndSensitivity(ModbusBuffer *buffer, uint8_t address, uint8_t channel,
81 float offset, float sensitivity);
82 void reset(ModbusBuffer *buffer, uint8_t address);
83 void readCalibration(ModbusBuffer *buffer, uint8_t address);
84 void reportDCAPressure(ModbusBuffer *buffer, uint8_t address);
85 void reportDCAID(ModbusBuffer *buffer, uint8_t address);
86 void reportDCAStatus(ModbusBuffer *buffer, uint8_t address);
87 void reportLVDT(ModbusBuffer *buffer, uint8_t address);
88 void nopReportLVDT(ModbusBuffer *buffer, uint8_t address);
89
90private:
91 ILCApplicationSettings *_ilcApplicationSettings;
92};
93
94} /* namespace SS */
95} /* namespace M1M3 */
96} /* namespace LSST */
97
98#endif /* ILCMESSAGEFACTORY_H_ */
void reportServerStatus(ModbusBuffer *buffer, uint8_t address)
Calls ILC function 18 (0x12) (ReportServerStatus).
Definition ILCMessageFactory.cpp:43
void pneumaticForceStatus(ModbusBuffer *buffer, uint8_t address)
Calls ILC function 76 (0x4C) Pneumatic ILC - Force [N] and Status Request.
Definition ILCMessageFactory.cpp:184
Utility class for Modbus buffer management.
Definition ModbusBuffer.h:42
Definition ILCApplicationSettings.h:37