I am trying to send data from TMS320F28335 to EPOS2 24/5 driver of Maxon Motor using CANOpen.
Previously, I used only SDO Protocol on velocity mode. But now I try to use PDO Protocol.
I refer to Fig. 1. to use velocity mode with SDO protocol.
PDO requires 'Mapping', 'RPDO', 'TPDO'...
It makes me complicate.
First quetion
I read datasheet of Maxon Motor. 'PDO Mapping' requires 'Pre-Operation Mode'.
From above figure, should I implement 'PDO Mapping' before 'Set Operation Mode'?
Second quetion
I use TPDO1, RTDO1 because I only want to acquire velocity of motor and send target velocity value to motor driver.
The first object of TPDO1 is 'Statusword'(index : 0x1A00, sub-index : 0x01, value : 0x60410010).
The sencod object of TPDO1 is 'Velocity Actual Value'(index : 0x1A00, sub-index : 0x02, value : 0x606C0020)
The first object of RPDO1 is 'Controlword'(index : 0x1600, sub-index : 0x01, value : 0x60400010).
The second object of RPDO1 is 'Target Velocity'(index : 0x1600, sub-index : 0x02, value : 0x60FF0020)
And then I send 'Set Operation Mode' packet to motor driver and send 'Shutdown', 'Enable' command as can be seen from figure 1.
After 'shutdown', 'enable' I don't know what to do next.
Third quetion
From figure 2, 'Operational Mode' can be done using 'Start Remote Node' command.
Then if 'Operational Mode' could be done by 'Start Remote Node' in NMT Protocol, how to set 'Velocity Mode' after 'Start Remote Node'?
Are there two method to set 'Operational Mode'?
Send '0x6060-00', '0xFE' in 'Set Operational Mode' step.
Use 'Start Remote Node' method of NMT Protocol.
If there are two method, how to set the velocity mode in second method?
Thank you for your comment.
Related
I need to write driver (DXE), that can transmit "couple of bytes" from virtual machine (QEMU) to the host system (OS - Ubuntu). I've read the UEFI_Spec and Guide for developers, but I still don't understand, how to write the code and what protocol should I use (tried to use TCPv4 but can't even LocateHandleBuffer).
EFI_STATUS Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiTcp4ProtocolGuid, NULL, &HandleCount, &HandleBuffer);
I get:
EFI_UNSUPPORTED
If somebody can explain me or can show examples of the code, I'll be very grateful. Thanks.
For most network related protocols you first have to use the corresponding "Service Binding Protocol" to get a handle which contains the protocol you are looking for.
Use this steps to access the Tcp4Protocol:
gBS->LocateHandleBuffer(ByProtovol,gEfiTcp4ServiceBindingProtocolGuid, NULL, &HandleCount, &HandleBuffer);
// Loop over the HandleBuffer Array and pick the one you need
gBS->HandleProtocol(HandleBuffer[YourIndex], &gEfiTcp4ServiceBindingProtocolGuid, &Tcp4SBProtocol);
Tcp4SBProtocol->CreateChild(Tcp4SBProtocol, &Tcp4Handle);
gBS->HandleProtocol(Tcp4Handle, &gEfiTcp4ProtocolGuid, &Tcp4Protocol);
To check if a NIC is available you can use:
// This should return EFI_SUCCESS
gBS->LocateProtocol(&gEfiSimpleNetworkProtocolGuid, NULL, &SimpleNetworkProtocol);
There is a complete code sample for the HttpProtocol inside the Uefi specification (starting at page 1548), the Tcp4Protocol is not very different.
I am using WsReceive() function of the ATEasy framework and wanted to ask what is the meaning of the values "aioDefault
and aioDisableWsReceiveEarlyReturn" of "enMode" parameter?
I found this in the ATEASY documentation:
If enMode, input receive mode includes aioDisableWsReceiveEarlyReturn,
it prevents WsReceive from an "early return" when there is a momentary
interruption in the data being received.
And this from the online help of ateasy (By a tip of an expert from the ateasy forum) :
If sEos parameter is an empty string and aioDisableWsReceiveEarlyReturn mode flag is not used (default case), the function will return immediately if characters are found in the input buffer, and the timeout will be ignored. Using the aioDisableWsReceiveEarlyReturn flag will ensure that the function will return only if the timeout is reached or all lBytes characters were received.
I am using TinyOS 2.1.0 under Xubuntos in my project. I want to get the
RSSI values in my simulation using TOSSIM as simulator. I used the command
call CC2420Packet.getRssi(msg)
The component is successfully buit. But when I built it for the simulation
(make micaz sim), i get an error saying that the component CC2420PacketC not
found.e
i used also :
event message_t* Receive.receive(message_t* pck,unit_8 len){
unit_8 Rssi_value=pck->metadata[1];
dbg(DBG_USR2, "Receive signal strength as %d\n"
(int)Rssi_value);
but i get allways 0 value for Rssi
From what I learned from the forums(https://www.millennium.berkeley.edu/pipermail/tinyos-help/2007-July/026348.html) TOSSIM always sends at 0dbm and doesn't give dynamic change in the signal strength. Remember simulators have the limitations and Tossim assumes everything runs smoothly. But if you are interested in estimating quality you should consider some other parameter such as gain which can be programmed using the TOSSIM.
I am writing a simple code to find the USB to serial port in Windows platform, if the port is what I want (can be filt by VID/PID number), then the program will open the port.
I use MonkeyBread plugin, WinUSBDeviceMBS, with property of VendorID and ProductID, I can select specific USB port. sample code as following.
Dim devices() As WinUSBDeviceMBS = WinUSBDeviceMBS.devices
For Each d As WinUSBDeviceMBS in devices
msgbox d.vendor+"-" + str(Hex(d.VendorID),"0000") + " " +d.product+"-" + str(Hex(d.ProductID),"0000")+d.serialnumber
Next
'this will give you a message box with "FTDI-0403 FT232R USB UART-6001 A60251HV"
Also, with help of Serial.serialport.Name, I can get the COM port name for serial device.
dim i, count as Integer
count = System.SerialPortCount
for i = 0 to count - 1
Msgbox System.SerialPort( i ).Name
next
'this will popup msgbox with "COM1" or "COM3"... all the valid port number, but no vendor info or product info
But I can't find a method to match those two together. Any ideas?
Assuming you are only using Windows you will need to use the registry to get this information.
You can get a list of all COM ports on the system here: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM. Values will be listed according to their type, so a real serial port will show up with a name \Device\Serialn and data COMxx, other devices might be different. If you look here you can find a name you can use to filter which type of device a COM port belongs to, then simply list these in your application.
You can do this in Xojo by using the Declare statement to hook into the API of the Windows DLLs:
https://docs.xojo.com/index.php/Declare
Here is a document on the Registry API functions, they will be used as described here, but using the Declare statement mentioned above:
http://support.microsoft.com/kb/145679
i use customer message and send it broadcast over radio channel, i use example 6 (CounterSend ) from this link .
when i build this project as micAz on mote 1, after this i use Xsniffer (TOSBase) on the mote that i will use it on the serial usb board (520).
after that i open Xsniffer program to see the radio packet and they appeared as following :
on other hand, to use Xserver i use XMeshBase then type on cygwin terminal :
xserve -device=com4
i got this!! but i can't understand what it received ?
how can i parse the data received ?? and named them as i want ?? ex: i need first byte be the source ??
how to do that ?