西安泽景光学自动化测试台架项目
- C# 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| lib | ||
| packages | ||
| SrsPlc | ||
| XIANRobotTest | ||
| .gitattributes | ||
| .gitignore | ||
| LICENSE | ||
| LICENSE.txt | ||
| README.md | ||
| XIANRobotTest.sln | ||
西安泽景光学自动化测试台架项目
项目描述
主要用于实现西门子PLC对机械臂和伺服控制轴的数据基本读写操作
更新记录
| 日期 | 说明 |
|---|---|
| 25.6.20 | 初版提交 |
| 25.6.23 | 优化代码结构及可读性 |
| 25.7.28 | 前往海壁自动化测试伺服部分控制逻辑,机械臂未测试 |
| 25.10.11 | 前往西安泽景实验室测试伺服和机械臂点位 |
接口列表
PLC连接
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 与PLC建立连接 | public bool Connect(string ip, string plcTypeString = "S1200") |
|
|
| 与PLC断开连接 | public void Disconnect() |
---- | ---- |
| 轮询PLC点位数据 | public (RobotModel,ServoModel) PollingPlcData(EServoIndex index) |
机械臂操作
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 机械臂移动至指定位置 | public bool RobotGoPosition(PositionModel position) |
机械臂数据写入(DB202)
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 设置机械臂位置 | public bool SetRobotPos(PositionModel position) |
||
| 设置机械臂启动 | public bool SetRobotOn(bool isOn) |
机械臂数据读取(DB203)
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 获取机械臂位置 | public PositionModel GetRobotPos() |
---- | |
| 获取机械臂状态 | public RobotStateType GetRobotState() |
---- | |
| 获取机械臂模式 | public RobotModeType GetRobotMode() |
---- | |
| 获取机械臂是否在移动 | public bool GetRobotIsMoving() |
---- |
伺服操作
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 伺服移动至指定位置 | public bool ServoGoPosition(EServoIndex eServoIndex, EServoPosition eServoPosition, float position, float speed) |
||
| 设置JOG点动 | public bool JOGMove(EServoIndex index, bool dir, bool flag) |
伺服数据写入(DB200)
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 设置伺服位置 | public bool SetServoPosition(EServoIndex eServoIndex, EServoPosition eServoPosition, float position) |
||
| 设置伺服速度 | public bool SetServoSpeed(EServoIndex eServoIndex, EServoPosition eServoPosition, float speed) |
||
| 设置伺服启动 | public bool SetServoOn(EServoIndex eServoIndex, EServoPosition eServoPosition, bool isOn) |
||
| 设置JOG点动 | public bool SetJOGMove(EServoIndex index, bool dir, bool flag) |
伺服数据读取(DB201)
| 功能 | 方法签名 | 参数说明 | 返回值 |
|---|---|---|---|
| 获取伺服实际位置 | public float GetServoActPos(EServoIndex eServoIndex) |
||
| 获取伺服到达状态 | public bool[] GetServoState(EServoIndex eServoIndex,int num) |
||
| 获取JOG互锁状态 | public bool GetJOGInlock(EServoIndex index, bool dir) |
||
| 获取伺服定位互锁 | public bool GetAutoInlock(EServoIndex index) |