我想找...

搜尋

分享

目錄

EthercatDevice_DmpDIQ.digitalWriteAll()

[EthercatDevice_DmpDIQ_Generic]

描述

Write the digital output state of all pins of the EtherCAT slave device simultaneously.

衍生類別:

Class          Name	        VID	        PID       Inputs Outputs   MCU	DC	Wire Detection
EthercatDevice_QECR00D0FS	0x00000bc3	0x0086d303	0	 16	        O		
EthercatDevice_QECR00D0FH	0x00000bc3	0x0086d30A	0	 16	        O	O	
EthercatDevice_QECR00D0TL	0x00000bc3	0x0086d327	0	 32			
EthercatDevice_QECR00D0TH	0x00000bc3	0x0086d801	0	 32	        O	O	
EthercatDevice_QECR00D88S	0x00000bc3	0x0086d309	8	 8	        O		
EthercatDevice_QECR00D88D	0x00000bc3	0x0086d301	8	 8	        O		O
EthercatDevice_QECR00D88H	0x00000bc3	0x0086d30F	8	 8	        O	O	
EthercatDevice_QECR00DC4D	0x00000bc3	0x0086d304	12	 4	        O		O
EthercatDevice_QECR00D4CD	0x00000bc3	0x0086d302	4	 12	        O		O
EthercatDevice_QECR11D0FS	0x00000bc3	0x0086d0d4	0	 16	        O		
EthercatDevice_QECR11D0FH	0x00000bc3	0x0086d305	0	 16	        O	O	
EthercatDevice_QECR11D0TL	0x00000bc3	0x0086d324	0	 32			
EthercatDevice_QECR11D0TH	0x00000bc3	0x0086d800	0	 32	        O	O	
EthercatDevice_QECR11D88S	0x00000bc3	0x0086d0d5	8	 8	        O		
EthercatDevice_QECR11D88D	0x00000bc3	0x0086d307	8	 8	        O		O
EthercatDevice_QECR11D88H	0x00000bc3	0x0086d308	8	 8	        O	O	

語法

int digitalWriteAll(uint32_t value);

參數

  • [in] uint32_t value
    This parameter is a 32-bit unsigned integer that specifies the value to be written to all digital output pins. Each bit in the value corresponds to a digital output pin of the EtherCAT slave device, with the following mapping:
    1. Bit 0 indicates digital output pin 0.
    2. Bit 1 indicates digital output pin 1.
    3. And so on, up to bit 31 which indicates digital output pin 31.

A value of 1 typically sets the corresponding pin to HIGH, while a value of 0 sets it to LOW.

回傳值

Return an error code. If the returned value is zero, it indicates a successful execution of this function.

備註

This function must be called after a successful execution of EthercatMaster::start() and before EthercatMaster::stop(). This function is non-blocking and can be called within the callback functions.

範例

#include "Ethercat.h"

EthercatMaster master;
EthercatDevice_QECR00D88D slave;

void setup() {
  master.begin();
  slave.attach(0, master);
  master.start();
}

void loop() {
  slave.digitalWriteAll(0x55555555);
  delay(1000);
  slave.digitalWriteAll(0xAAAAAAAA);
  delay(1000);
}

Please see EthercatDevice_DmpDIQ_Generic類別 for more QEC DIO slave instructions and API usage.

返回頂端