42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
/*
|
|||
|
|
* Copyright (c) 2025 Beijing Hardman Automation Equipment Co., LTD. All rights reserved.
|
||
|
|
*
|
||
|
|
* Project: adapter
|
||
|
|
* File: temp_station.go
|
||
|
|
* Last: 2025-01-13 20:04:51
|
||
|
|
* Author: wangcheng@bj-hardman.com
|
||
|
|
*/
|
||
|
|
|
||
|
|
package robot
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
"bj_power_mes/internal/preload"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PlaceWorkpieceToTempStation 将工件放置到暂存台
|
||
|
|
func (c *Controller) PlaceWorkpieceToTempStation(ctx context.Context, workpieceType int, slot int) error {
|
||
|
|
return c.executeAction(ctx, "PlaceWorkpieceToTempStation",
|
||
|
|
newArg(int8(workpieceType), "workpieceType"), //工件类型
|
||
|
|
newArg(int8(slot), "slot"), //工件位置号
|
||
|
|
newArg(int16(0)),
|
||
|
|
newArg(int32(0)),
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
// FetchWorkpieceFromTempStation 从暂存台取工件
|
||
|
|
func (c *Controller) FetchWorkpieceFromTempStation(ctx context.Context, workpieceType int, slot int) error {
|
||
|
|
return c.executeAction(ctx, "FetchWorkpieceFromTempStation",
|
||
|
|
newArg(int8(workpieceType), "workpieceType"), //工件类型
|
||
|
|
newArg(int8(slot), "slot"), //工件位置号
|
||
|
|
newArg(int16(0)),
|
||
|
|
newArg(int32(0)),
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
// TempStates 获取随行暂存台槽位状态
|
||
|
|
func (c *Controller) TempStates() ([]bool, error) {
|
||
|
|
addr := preload.GetMAddress("TempStates")
|
||
|
|
return c.plcClient.ReadBools(addr.Addr.String(), 8)
|
||
|
|
}
|