I am using PI motion controller which has integrated DSP Processor (we don't have any details about the Processor). I have programmed the motion controller to drive piezo motor using MATLAB however i would now want the motion controller to recognize command sent from the UART (UART2) port of LPC2478. I already set the baud-rate and number of bits to be sent identical to the one given in datasheet and i also used the same setting in MATLAB program.
I feel that the 3rd party device is receiving the data but maybe is not able to interpret.
We are trying to send a text based command (like, MOV 1 8)
When we were programing through MATLAB it need certain DLL files but when we are trying to program it via keil , it doesn't support a DLL file. How should we import a DLL file in keil or other than using a dll, will there be any other way to make the motion controller recognize our commands.
BLOCK DIAGRAM
KEIL ---> ARM (LPC2478) ---> UART -|-|-|- 3rd party device UART ----> DSP Processor ---> PIstage (error in communication)
Sorry, but too little info given.
You don't mention anything about what motion controller you have.
You mention DLL files, but don't mention what the DLL files were expected to do.
Keil (we have to assume the IDE) don't need any extra DLL files for this project. The Keil tools are just there to create a project for a microcontroller and (optionally) to download that binary into the processor.
The microprocessor obviously do not make use of any DLL files. It just runs the programs you write and download into it. And it doesn't take any DLL files for the microcontroller to be able to communicate on the UART.
Note, however, that the microcontroller UART talks logic-level signals, while a PC serial port has level shifters to communicate with RS-232 signal levels. So if that motion controller have a serial port that can be connected directly to a PC (or a USB-connected serial port on the PC), then you need to have a RS-232 transceiver chip. For a microcontroller that has 3.3V logic levels, a MAX3232 might be used.
So if the motion controller connected to the UART do support specific serial commands, then it is enough that you write a program that sends the correct commands. Note that in case it takes the commands as ASCII strings, then it might be sensitive to used end-of-line characters used when esnding the commands. In C, you have \r for carriage return and \n for new line. And, depending on setup, the \n in the source code might be expanded into a sequence of both characters.
Yes, we are using the KEIL IDE.
We are using the PI C867 PILine Controller by PHYSIK INSTRUMENTE to drive a piezo nano positioning stage.
DLL file are provided to us by the company itself as a part of their software support. These libraries are used during run time of the MATLAB program. We can't be sure but we assume that they contain the translation of the PI GCS (General Command Set).
we tried to send these following commands :-
UART_PRINTF("MOV 1 4");
or
UART_PRINTF("MOV 1 4\r\n");
None of them are working. We are wondering if the manner in which we are sending end character is correct.
We also tried to send command set like :-
UART_PRINTF("MOV 1 4"); UART_PRINTF('\n'); UART_PRINTF('\r');
UART_PRINTF("MOV 1 4"); UART_PRINTF('\r'); UART_PRINTF('\n');
UART_PRINTF has been tested to work properly.
The motion controller only support those languages which support loading of DLLs. In VB++ they included windows (#include <windows.h> #include <conio.h>) and DLL files similar to C++.
So, is there any way by which we can bypass these DLL files using KEIL IDE.
It doesn't matter to the Keil IDE that they have supplied you with DLL files.
The Keil IDE do not care about any DLL files related to any motion controller. The Keil IDE isn't even involved in the running of software within your microcontroller. And no - the microcontroller will not care anything about any existence of any DLL files either.
So it all comes down to the documentation you have for this motion controller of yours. That documentation should be able to inform you exactly the format of the commands sent to it. Unless, they actually have a motion controller with a undocumented communication protocol, and have Windows DLL files that specifically takes text commands and parses the commands and send something completely different to the motion controller. In that case, you are stuck.
If you don't understand the documentation you have for this motion controller, then you need to speak to the manufacturer and/or supplier for support on that - it has nothing to do with Keil!
You mean this:
"
Nonsense!
The motion controller neither knows nor cares what is used to send commands - just so long as the correct commands arrive at its port, in the correct format.
You need to contact PHYSIK INSTRUMENTE for documentation on what, exactly, those commands & formats are.
If you want to reverse-engineer the communication, you will need some sort of serial port "sniffer" (aka "monitor" or "analyser") to see exactly what is being sent to the unit, and exactly how it responds...
www.physikinstrumente.com/.../support
Sir, I used a USB sniffer(USB Monitor Pro) and sent commands using MATLAB through a PC to Motion Controller (like i used to before i had started interfacing it with LPC2478).
This software on any bulk transfer (like copying pdf to a pen drive) has a monitor window which shows what is being sent from the device and to the device. During the process of sending command i could see number of changes happening in FLINK and BLINK but there is no information about data being sent to the device. From the device we are receiving "01 60" in hex continuously.
Could you recommend possibly a better USB Sniffer.
Baudrate and number of bits set - then you suddenly talk about a USB sniffer. Why?
Exactly what interface do you have between PC and motion controller. Baudrate and number of bits would normally indicate a RS-232 link. You don't set these parameters for a USB channel - USB have automatic methods to figure out transfer rates, and don't have any setting for number of bits, being designed around frames of varying number of bytes.
Their web page mentions "USB, RS-232", but sniffing the USB interface is not guaranteed to tell you the protocol information on the RS-232 port, unless that USB is just presenting the motion controller as an extra serial port on the PC.
Have you done that yet?