What the library contains
| Element | Role |
|---|
MBC_TMPL_CVRT | Modbus client template containing the drive registers. Registers with one decimal place use the REAL type and are scaled by 10 in the template; the remaining registers are passed through without scaling. |
InverterCoolvert | Control block for the line address and timeouts, online status, installation and consistency checking of CFG_DRIVE, control word and speed setpoint, trip handling and reset, and estimation of whether the compressor is still running while the drive is offline. |
InverterCoolvert_SafetyBlock | Protection-parameters block for P5-07 and P5-18 (current limits), P7-02 (automatic-reset delay), P7-12 and P7-13 (locked-rotor detection), and drive identity. The data is stored in SAFETY_CFG, protected by a CRC checksum. |
InverterCoolvert_Ui | Links the screens to the drive and handles manual mode, commands from the parameter lists and resets. |
MenuWidget, ManualModeWidget, ControlWidget, InfoWidget | pGD1 screens: a group and command menu showing drive status, risk acknowledgement and manual mode, control with measurements, trip history and an “About” page. |
The control block inputs are Enable, Address, RunCmd, SpeedPct, HeatCmd (crankcase heater), FaultReset and the configuration. Outputs include CanStart, Online, CommLost, Faulted, FaultCode, RunsOffline and the Info structure containing the consistency-check status, measurements and Modbus counters.
Quick start
- Add
InverterCoolvert_v.0.2.0.stlib to the project (Dependencies › Libs) and add USING Libs.InverterCoolvert;. Qualify names with the InverterCoolvert. prefix. Do not add a USING declaration for the inner namespace, as names such as Ui and ON_OFF could conflict with names used by the application. - In
ClientProtocols.stmp, configure a Modbus client on the RS-485 port and add a device that uses the MBC_TMPL_CVRT template. Set the device path to the instance’s MBC_Cvrt field. - Declare the persistent variables and call the block on every cycle of the drive task.
USING Libs.InverterCoolvert;
VAR_GLOBAL PERSISTENT
CfgDrv : InverterCoolvert.CFG_DRIVE;
InstallReq : BOOL;
InstallDone : BOOL;
InstallError : BOOL;
StoredSerial : InverterCoolvert.DRIVE_SERIAL;
END_VAR
VAR_GLOBAL
Cvrt1 : InverterCoolvert.InverterCoolvert;
END_VAR
(* drive task, interval up to 500 ms *)
DriveLine.Init(); (* does nothing once the line is started *)
DriveLine.Read();
Cvrt1(Address := 1, SpeedPct := SpeedRequest, RunCmd := RunRequest, Enable := TRUE,
CfgDrive := CfgDrv, InstallReq := InstallReq, InstallDone := InstallDone,
InstallError := InstallError, StoredSerial := StoredSerial);
DriveLine.Write();
- Enter the motor data in
CfgDrv.P1 (P1-07–P1-10) and set the control mode in P5.P5_01_CtrlMode. Then set InstallReq to TRUE. The library resets this request when installation is complete. The first installation always requires InstallReq; after that, a drive with a new serial number is configured automatically. - To display the parameters on the terminal, copy the
DrvCfg.*, SafCfg.* and Drive.MBC_Cvrt.* entries from the demo application’s Parameters.stparam, EN.lang and Workspace.spark files. Adjust the names to match the global variables in your project.
The demo application contains a complete example, including the protection-parameters block, screens and navigation.
Demo application
The CoolvertDemo application uses the published library rather than its source code. It supports one drive connected to the FBUS1 port of a c.pCO mini. It includes the library screens, native parameter lists, the protection-parameters block, and a ready-to-use Firmware#App-CoolvertDemo-0.2.0.pack file containing the Manufacturer, Service and User profiles and parameter descriptions.
- Unpack the archive and open
Demo/CoolvertDemo.stone in STone 2. The required CAREL libraries, SystemMenu_v.1.0.7.stlib and ParamListWidget_v.1.3.3.stlib, are already in the Libs folder. - Download the
.pack file to the controller using CAREL Sparkly, for example: Sparkly.exe app download --src "Pack\Firmware#App-CoolvertDemo-0.2.0.pack" --connection Serial,COM3,1152008N2,248. Each time it starts, the application unpacks the profiles and parameter descriptions from the .pack file. - If you modify and build the application yourself, build the Release configuration and create a new
.pack file using Sparkly.exe pack-file create and pack-file embed-from-spark with Workspace.spark, as described in README.md. - In the P1 list enter the motor data (P1-07 to P1-10) and set
C01 = Write.
The parameter-list commands are: C01 synchronises the motor configuration (Write: controller → drive; Read: drive → controller); C02 synchronises the protection parameters (Write: sign and write; Read: read and sign); C03 resets the drive trip; C04 resets the protection-parameters alarm; and C05 enables the drive.
Requirements
- CAREL STone 2 version 2.0.7 or later. The library was built with version 2.0.7.1426.
- A CAREL controller with an RS-485 port (for example, FBUS1) and a pGD1 terminal. The library project targets the c.pCO; the demo application targets the c.pCO mini.
- An Invertek Optidrive Coolvert drive connected to the controller’s RS-485 port. Drive defaults: address 1, 115,200 baud, 8N1.
- CAREL Sparkly to load the parameter profiles. Without the profiles, the terminal lists display No tag.