background image

WriteNow! User's Manual

 

 

 
 

43 

WN_CloseCommPort() 

Prototype

 

ASCII version: 

WN_COMM_ERR WINAPI WN_CloseCommPortA (WN_COMM_HANDLE handle);

 

 

Unicode version: 

WN_COMM_ERR WINAPI WN_CloseCommPortW (WN_COMM_HANDLE handle);

 

Description 

Closes the communication channel with the instrument. 

Return Value 

0

 

The function call was successful. 

!=0

 

The function call was unsuccessful. Call the

 

WN_GetLastErrorMessage() 

function to get error information. 

Parameters 

handle

 

Communication handle returned by the

 WN_OpenCommPort() 

function. 

 

 

http://smh-tech.com.cn  http://algocraft.com.cn  [email protected]  +86-15250087885

Содержание WN-PRG01A

Страница 1: ...WriteNow Series Single and Parallel In System Programmers User s Manual Rev 1 05 UM00010105EN http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 2: ...s used by Algocraft for warranty work may be new or reconditioned to like new performance All replaced parts modules and products become the property of Algocraft In order to obtain service under this...

Страница 3: ...a New Project Step 1 of 3 12 5 Create a New Project Step 2 of 3 13 6 Create a New Project Step 3 of 3 15 7 Configure your WriteNow Instrument 16 8 Connect to Target Device 16 9 Startup WriteNow 16 10...

Страница 4: ...Commands 29 Execution Command 30 File System Commands 31 Programming Commands 32 Status Commands 33 System Commands 34 Time Commands 36 Volatile Memory Commands 37 6 Standalone Mode 39 Overview 39 Sig...

Страница 5: ...ptions 57 Power Supply 57 Relays 57 11 Demultiplexer Module 59 Overview 59 12 Connectors 61 ISP Connectors 61 Low Level Interface Connector 62 Ground Domains 64 13 Specifications 65 Electrical Specifi...

Страница 6: ...http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 7: ...o use software utilities The WriteNow Lineup Features Support of microcontrollers serial and parallel memories and other programmable devices High speed parallel programming Compact size fixture frien...

Страница 8: ...SWD etc UART SPI JTAG I2 C BDM SWD etc UART SPI JTAG I2 C BDM SWD etc UART SPI JTAG I2 C BDM SWD etc Relay Barrier Yes No No No ISP Lines Adj Voltage Range 1 6 5 5V 1 6 5 5V 1 6 5 5V 1 6 5 5V Adj Vol...

Страница 9: ...WER connector accepts a DC voltage between 12V and 25V 2 The LAN and RS 232 connectors are used to interface the instrument to a PC 3 The LAN RESET push button is used to reset LAN settings to their f...

Страница 10: ...sful red otherwise WN PRG01A LEDs WN PRG02A LEDs WN PRG04A LEDs WN PRG08A LEDs Programming Drivers and Licenses WriteNow comes with preinstalled programming drivers algorithms that support common micr...

Страница 11: ...the Setup CD into your PC and install the WriteNow software 2 Launch the Project Generator Launch the Project Generator application that is located under Programs Algocraft WriteNow Software Project...

Страница 12: ...ng the Edit button Then specify the file to be programmed image file To create an image file click the Create Edit File button A dedicated window will open In the Output File section specify the outpu...

Страница 13: ...SP lines You should check the target board schematics or ask the board developer about this value The allowed voltage also depends on the selected target device The Clock I O drive mode setting allows...

Страница 14: ...urrent output is limited to about 400mA The Power up time setting specifies the delay between the programmable power supply line turning on and the first operation on the ISP lines The purpose of this...

Страница 15: ...t Step 3 of 3 In this step you select which programming operation to perform on the target The read FLASH memory will create a dump file located in the images folder It could be performed one site at...

Страница 16: ...erial port 8 Connect to Target Device Connect WriteNow to your target system through the ISP connector s To view the connections for your selected target device select Debug Show ISP Connections 9 Sta...

Страница 17: ...he Project file created by the Project Wizard is located by default in the Projects directory relative to the Project Generator application location this location can be to do so in the Project Genera...

Страница 18: ...ng answers using the Project Generator Terminal or any other terminal application for more information see Commands on page 27 2 By configuring the instrument so that it can work in standalone that is...

Страница 19: ...ngs This section describes the simple procedure for the COM LAN setup COM WriteNow communicates at 115 200 bps by default On windows system check the properly COM port number in the Device Manager win...

Страница 20: ...nected directly to your PC In this case or if you want to configure your LAN manually you must set a static IP On windows system go Set the properly IP subnet mask and the default gateway After the fi...

Страница 21: ...ools information Firmware Upgrade To update the firmware click on the Firmaware Upgrade button Then you can choose the properly wncore01 version It is located in Programs Algocraft WriteNow Software s...

Страница 22: ...The diagnostic procedure is a very easy way to verify if some hardware faults occur Use the provided test board to check the connections to all the ISP sites http smh tech com cn http algocraft com c...

Страница 23: ...imized for reading and writing data When the image file is created the CRC32 and the MD5 values are shown in order to check the file integrity information The CRC32 and MD5 values are not calculated o...

Страница 24: ...ata from the programming through the new file range section For Example if you want to skip the first 64KB The buffer range values are used to set the offset for the start address and the end address...

Страница 25: ...k that will contain the variable data the maximum data length available is 512 bytes 2 Proceed to the end of the Project Creation wizard Your programming project is now ready to accept variable data 3...

Страница 26: ...FF see the following section Fill Unused Location This option allows to program the skip areas included in the source file SREC or HEX format with the specified value The main reason to use this optio...

Страница 27: ...swers with an ERR frame 3 If the command takes long to execute the programmer periodically answers with a BUSY frame until command execution is over and an OK or ERR frame appears All commands and ans...

Страница 28: ...be sent and answers received using any terminal application For your convenience the Project Generator application includes a Terminal window that will simplify the communication with the instrument...

Страница 29: ...input image file to be programmed and subsequently programs it data o set c in t file f images myfile wni prog o cmd c program m flash s h8000 t h8000 l h8000 If you add the s MD5 CRC32 flag the progr...

Страница 30: ...1 was successful bit 0 or not bit 1 To retrieve error messages use the status o get p err v site l errlevel command where site is 1 to 8 to retrieve a specific programming site error or 0 to retrieve...

Страница 31: ...wni p info r CRC32 Parameters directory Full path of a directory filename Full path of a filename Description Examples Shows the contents of the fs o dir d 2010 06 21 16 35 06 DIR projects 2010 06 21...

Страница 32: ...tgt addr l len prog o cmd c verify v ver mode m mem type t tgt addr l len prog o cmd c read m mem type s dst addr t tgt addr l len Parameters driver Filename of the wnd driver manufacturer acturer dev...

Страница 33: ...orithm specific Bit 27 If 1 the error is a system fatal error Bits 26 to 24 Reserved Bits 23 to 0 Error code If bit 29 is 1 then bits 7 to 0 signal whether programming in the corresponding programming...

Страница 34: ...o set p protection password password enable yes no sys o set p user name admin operator password password sys o rst Parameters baud rate 9600 19200 38400 57600 115200 or 230400 code sys or driver prj...

Страница 35: ...figuration IP sys o set p ip v 10 0 0 10 Netmask sys o set p nm v 255 255 255 0 Gateway sys o set p gw v 10 0 0 1 The new configuration will be added after the programmer reboot Reset via software sys...

Страница 36: ...the format yyyy mm dd time A time in the format hh mm ss Description when the instrument is powered off Examples Sets the date time to February 1st 2011 at noon time o set p date d 2011 02 01 time o...

Страница 37: ...et specific site data 0 to set the same data for all sites start address Volatile memory starting address len Data length data A data array Description Read Examples volatile o write s 1 a h0 l 6 d h0...

Страница 38: ...http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 39: ...programming site s to enable Active low START line input Executes the project specified by PRJ_SELx lines on the programming site s enabled by START_ENAx lines Active low BUSY line output Indicates th...

Страница 40: ...In the window that will appear associate PRJ_SEL values to project names by clicking the Set Project button for each PRJ_SEL configuration you wish you setup Previous state New state PRJ_SELx and STA...

Страница 41: ...programming command from the stdin sends the command to the instrument and writes the command answer on the stdout For example using the following commands to send a file through the COM or Ethernet...

Страница 42: ...betically in the following pages 1 Open communication WN_OpenCommPort function 2 Execute commands WN_ExeCommand function WN_SendFile and WN_ReceiveFile functions 4 Close communication WN_CloseCommPort...

Страница 43: ...ANDLE handle Description Closes the communication channel with the instrument Return Value 0 The function call was successful 0 The function call was unsuccessful Call the WN_GetLastErrorMessage funct...

Страница 44: ...endFrame and WN_GetFrame function in a single call Return Value 0 The function call was successful 0 The function call was unsuccessful Call the WN_GetLastErrorMessage function to get error informatio...

Страница 45: ...nd sent by the WN_SendFrame function Return Value 0 The function call was successful 0 The function call was unsuccessful Call the WN_GetLastErrorMessage function to get error information Parameters h...

Страница 46: ...ion void WINAPI WN_GetLastErrorMessageW wchar_t error_msg unsigned long string_len Description Returns a string containing the last WriteNow error message Parameters error_msg The string that will rec...

Страница 47: ...successful 0 The function call was unsuccessful Call the WN_GetLastErrorMessage function to get error information Parameters handle Communication handle returned by the WN_OpenCommPort function proto...

Страница 48: ...ful 0 The function call was unsuccessful Call the WN_GetLastErrorMessage function to get error information Parameters handle Communication handle returned by the WN_OpenCommPort function protocol Tran...

Страница 49: ...ption Sends a command to the instrument Use the WN_GetFrame function to retrieve the answer Return Value 0 The function call was successful 0 The function call was unsuccessful Call the WN_GetLastErro...

Страница 50: ...ommunication channel with the instrument Return Value 0 Valid communication handle to use in subsequent functions NULL The function call was unsuccessful Call the WN_GetLastErrorMessage function to ge...

Страница 51: ...ee the instrument file structure and transfer files with the PC To open the File Manager choose Tools WriteNow File Manager from the Project Generator menu File System Structure The files required by...

Страница 52: ...m a target device memory These files are created by the Project Generator application You can create additional folders but the four folders listed above must always be present on the WriteNow file sy...

Страница 53: ...WriteNow User s Manual 53 http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 54: ...http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 55: ...vel is 02 and the user mode is operator To disable the data protection and get access to file transfer you must enter in admin mode by using the previous password sys o set p user name admin password...

Страница 56: ...ges myimage wni Protection model Protection enable User Operator n o n e none Protection enable User Admin n o n e none Files to be transferred must be encrypted with PASSWORD in wnef format Set prote...

Страница 57: ...ject with the relay o close command and opened at the end with the relay o open command every programming site If the programming site is enabled this signal is driven to 0V when a relay o close comma...

Страница 58: ...http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 59: ...logy ensures true galvanic isolation and reliability For the power supply a special plug to plug power cable is provided with demultiplexer in No external lines are needed in order to control the mult...

Страница 60: ...f project s sites dmux channel Models Nmb Boards in parallel Demux model Nmb Boards in demultiplexing WN PRG01A 1 WN PRG02A 2 WN DM2X2A 4 WN DM2X3A 6 WN DM2X4A 8 WN PRG04A 4 WN DM4X2A 8 WN DM4X3A 12 W...

Страница 61: ...G08A ISP Connectors Low level interface Site 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 C B A WN PRG01AISPConnector Site 2 Site 1 WN PRG02AISPConnector 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 C B A Site...

Страница 62: ...Connector Low Level Interface Connector 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 C B A One of the most important parameters to take into account for ISP wiring is connection length For this reason the...

Страница 63: ...l up B7 B7 B7 START_ENA2 Site 2 Project Start Enable Input internal pull up C7 C7 C7 START_ENA3 Site 3 Project Start Enable Input internal pull up A8 A8 START_ENA4 Site 4 Project Start Enable Input in...

Страница 64: ...ns ATE System Low Level Interface ISP Target Board ATEGND GNDI GND TARGETGND In order to avoid undesired current paths between the programmer and the target board we suggest to use a power supply with...

Страница 65: ...PRJ_SELx START START_ENAx BUSY OK ERRx voltage 0 5 0V Physical and Environmental Operating conditions 0 40 C 90 humidity max without condensation Storage conditions 10 60 C 90 humidity max without co...

Страница 66: ...C style Manufacturer FCI Manufacturer Part Number 86093488613755E1LF Catalog Part Number Mouser 649 8693488637E1L Cables Ribbon cable 30 cm DIN41612 connector 48W female male Manufacturer Algocraft M...

Страница 67: ...WriteNow User s Manual 67 http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 68: ...WriteNow User s Manual 68 http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 69: ...WriteNow User s Manual 69 http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 70: ...WriteNow User s Manual 70 http smh tech com cn http algocraft com cn sales smh tech com cn 86 15250087885...

Страница 71: ...gram Files x86 Algocraft WriteNow Software X XX make sure you have full control of it 1 Open File Explorer and then locate the command utility line folder 2 Right click on the folder click properties...

Страница 72: ...the Add button The Permission Entry window will appear on the screen Click Select a principal and select your account 5 Set permissions to Full control http smh tech com cn http algocraft com cn sale...

Отзывы: