background image

EtherSpaceLink-RG408

EtherSpaceLink family User Manual

int main (int argc, char * argv [] )
{

unsigned char HWA[6];
pthread_t th_rx;

/* Thread for receiving packets */

pthread_t th_tx;

/* Thread for sending packets */

int ports;
int status;

if (argc < 3)
{ fprintf ( stderr,

"Usage: %s <ESL IP address> <filename to tx> <filename to rx>\n",
argv[0]);

exit (1);

}

printf ("Connecting to %s ... ", argv[1] );
fflush ( stdout );

ESL_unit = EtherSpaceLink_open ( argv[1] );

if ( ESL_unit == 0 )
{

fprintf ( stderr, "\n"

"Failed to establish connection to EtherSpaceLink\n"
"

[Are you using the correct IP address?]\n"

"

[Is the network OK?]\n"

);

exit (1);

}
printf ("OK\n");

/** Receive timeout allows shutdown to work */

EtherSpaceLink_get_HWA ( ESL_unit, HWA );
ports = EtherSpaceLink_get_number_of_links ( ESL_unit );

EtherSpaceLink_set_speed ( ESL_unit, 100 );

// Set link speed to 100 Mb/sec

printf ( "%s",

EtherSpaceLink_get_manufacturer_string ( ESL_unit ) );

printf ( " %s", EtherSpaceLink_get_product_string ( ESL_unit ) );
printf ( " (%i ports)\n", ports );
printf ( "Serial number %s",

EtherSpaceLink_HWA_to_serial_number_string ( HWA ) );

printf ( " at %2.2X-%2.2X-%2.2X-%2.2X-%2.2X-%2.2X",

HWA[0], HWA[1], HWA[2], HWA[3], HWA[4], HWA[5] );

printf ( "\n\n" );

status = EtherSpaceLink_set_active_link ( ESL_unit, 1

/*tx_link*/ );

status = EtherSpaceLink_set_mode ( ESL_unit, EtherSpaceLink_LINK_mode_normal );

/* Set ESL to report received timecodes */
EtherSpaceLink_set_timecode_receive ( ESL_unit, 1);

rx_fd = fopen (argv[3], "wb");
if (rx_fd == NULL)
{ fprintf (stderr, "Cannot open file ’%s’\n", argv[3]);

exit (1);

}
else
{ printf ("Opened ’%s’\n", argv[3]);
}

strncpy (filename, argv[2], sizeof(filename));

4Links Limited
www.4Links.co.uk
[email protected]

page 49 of 110

T +44 1908 642001; F +44 1908 363463

Milton Keynes MK3 6EB, UK

Suite EU2, Bletchley Park

Summary of Contents for EtherSpaceLink Series

Page 1: ...ditional software drivers are not required The Ethernet port provides a galvanically isolated connection with a cable length of up to 100 m Attaching this to the Internet allows world scale connections There is no limit to the length of the SpaceWire packets transferred The basic EtherSpaceLink unit provides data transfers and may be extended with options to provide for time codes event reporting ...

Page 2: ... of 2013 09 17 Variant a4 RG408 Legal notice and disclaimer Copyright 2012 2013 4Links Limited all rights reserved The name 4Links and the accompanying device are registered as a Trademark in the European Union and in the United States of America The information supplied in this document is believed to be accurate at the date of issue 4Links reserves the right to change specifications or to discon...

Page 3: ... 11 2 7 Programming API 12 3 Specification 13 3 1 SpaceWire Links 13 3 1 1 SpaceWire Receive Performance 13 3 1 2 SpaceWire Transmit Performance 13 3 1 3 SpaceWire Connectors 13 3 1 4 SpaceWire Time Codes 14 3 2 The Ethernet Connection 14 3 2 1 ICMP Echo ping Support 14 3 2 2 Full Duplex Ethernet 14 3 3 SMA Synchronization Connectors 14 3 4 Discovering a Unit s Serial Number and Installed Product ...

Page 4: ...cation Programming Interface 35 13 5 Waveform Handling 35 14 C language Application Programming Interface 36 14 1 EtherSpaceLink Family Architecture and Programming Model 36 14 1 1 Principles of Operation 36 14 1 2 Terminology 37 14 1 3 Protocol Hierarchy 37 14 1 4 The Ethernet Connection to an EtherSpaceLink Unit 38 14 1 5 The EtherSpaceLink Protocol 38 14 1 6 SpaceWire Transmissions 39 14 1 7 Mo...

Page 5: ...herSpaceLink_set_active_link 82 14 6 22 EtherSpaceLink_get_manufacturer_string 83 14 6 23 EtherSpaceLink_get_product_string 84 14 6 24 EtherSpaceLink_get_HWA 85 14 6 25 EtherSpaceLink_HWA_to_serial_number_string 86 14 6 26 EtherSpaceLink_get_module_slot 87 14 6 27 EtherSpaceLink_get_control_packet 89 14 6 28 EtherSpaceLink_extract_module_type 90 14 6 29 EtherSpaceLink_set_timecode_receive 91 14 6 ...

Page 6: ...oduct Safety 105 19 3 Equipment Recycling 105 19 4 Restriction of Hazardous Substances 105 20 RG408 Product Drawings 106 20 1 Plan views 106 20 2 Front views 108 20 3 Rear views 109 4Links Limited www 4Links co uk support 4Links co uk page 6 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 7: ... for advice Do not operate in wet or damp conditions Do not operate in an explosive atmosphere Keep product surfaces clean and dry Provide proper ventilation The air inlet and outlet on the rear panel must not be obstructed 1 1 Terms in this Manual CAUTION Caution statements identify conditions or practices that could result in damage to this product or to other property 1 2 Symbols on the Product...

Page 8: ...am on the host and also from the program to the SpaceWire link There is no limitation on the size of packet transfers in each direction not even as a result of finite buffer sizes The user has complete control over the SpaceWire packet content and structure a packet may be sent or received in segments The host program can also control the transmission speed of the SpaceWire links The transmit spee...

Page 9: ...rom there it will be returned to the host computer where it can be displayed and recorded java jar SpWIO jar u 192 168 3 40 4Links SpWIO v24 20111201 v33 20110920 on Tue May 07 04 52 57 BST 2013 u 192 168 3 40 Attached 192 168 3 40 is ESL RG201 v1 5 1 port link mode is normal at 10 0Mb s Log file is SpWIO_20130507_045259 log Input from console 1 2 4 6 8 eop Tx 1 02 04 06 08 EOP Rx 1 02 04 06 08 EO...

Page 10: ...ically resulting in a link reset and replaced by at most an EEP character can be made visible to the user Correct but normally hidden tokens such as flow control tokens can also be transferred to the user 2 4 2 EW Event Error Waveforms The SpaceWire port has an associated waveform store that captures transmit and receive wire signals for that port Waveform captures can be triggered on a wide varie...

Page 11: ...thernet transmit and receive activity occur 2 5 2 SpaceWire information Information about the SpaceWire links is shown on the lower section of the display The speed of transmission and reception on each link is shown and any receive or transmit activity is indicated 2 6 Communication Protocols 4Links EtherSpaceLink units provide access to a SpaceWire network from computers on a conventional TCP IP...

Page 12: ...d but the EtherSpaceLink unit will have lost connection information and the computer application program will have to be restarted Similarly a failure of the computer will leave the EtherSpaceLink unit waiting for a connection restoration that is not possible and in this case the EtherSpaceLink unit must be reset by cycling power or by removing and re inserting the removable memory card on its fro...

Page 13: ...er speed Mb s 400 0 2 0 498 0 40 0 1 0 400 0 4 0 0 1 39 9 1 00 0 01 3 99 3 1 3 SpaceWire Connectors Eight standard 9 way Micro miniature D type SpaceWire socket connectors are mounted either on the front panel on RG hardware platforms or on the rear panel on RG R platforms The connectors are labelled 1 to 8 from left to right corresponding to software and API ports 1 to 8 respectively The pinout o...

Page 14: ...to an ICMP echo request as provided on many operating systems via the ping command This can provide a simple test to check that the unit is accessible on the network 3 2 2 Full Duplex Ethernet Only full duplex Ethernet connections are supported 3 3 SMA Synchronization Connectors Synchronization to other 4Links units or to external devices is achieved using SMA connectors on units with the S model ...

Page 15: ...rm Annn e g A202 The least significant bits of the Ethernet Media Access Control MAC address of a unit are directly related to its serial number Serial numbers MAC addresses A1 to A4095 00 50 C2 21 20 01 to 00 50 C2 21 2F FF 3 4 2 Installed Product Options When viewing the serial number of a running unit as above the installed Product Options are listed as two character acronyms within square brac...

Page 16: ...ial Maximum height 45 mm 1 75 inches Maximum width 483 mm 19 inches Maximum depth overall 335 mm 405 mm with mated power connector 13 25 inches 16 inches with mated power connector Maximum depth inside rack 290 mm 360 mm with mated power connector 11 5 inches 14 25 inches with mated power connector Weight Approximately 2 8 kg Approximately 6 lb Heat output power consumption Approximately 25 Watts ...

Page 17: ... at its mains voltage input and should be used where surge protection is required CAUTION The AC DC adapter supplied with the unit provides mains isolation to UL60950 EN60950 If an alternative power source is used it must have an equivalent rating 3 5 3 2 Power Consumption Total power consumption depends on the number of active ports and options up to around 25W 3 5 3 3 Power Connector Power is su...

Page 18: ...ct 4Links CAUTION There are no user serviceable parts inside this equipment 3 5 4 Handling and Transportation The 4Links RG platform products are designed to be robust and are capable of being transported to support SpaceWire testing Units should be packaged in protective foam or similar material to prevent them from being subjected to excessive shocks during handling Units should not be subjected...

Page 19: ...pressing the eject button on the right hand side of the card slot with a non conductive device CAUTION Do not attempt to remove the memory card using a conductive object e g a pen or a screwdriver Memory cards are configured for a particular 4Links hardware platform and are only intended for use with that unit If one attempts to boot a 4Links unit with a memory card that was built for another unit...

Page 20: ... panel display memory card connector in SFP module Micro D SpaceWire connectors monitoring and thermal control Removable Front panel switch Ethernet TCP IP interface SpaceWire Link interfaces Transmit and receive buffers SMA synchronisation connectors S units only Figure 4 1 EtherSpaceLink family unit block diagram 4Links Limited www 4Links co uk support 4Links co uk page 20 of 110 T 44 1908 64200...

Page 21: ...operation the display shows the state of the SpaceWire and Ethernet connections and any activity on these interfaces Figure 5 2 The ESL RG408 status display The top line of the display shows Ethernet information The IP address of this unit The lower section of the display shows information about the connection Which of the SpaceWire ports is the active one SpaceWire link status and activity Disabl...

Page 22: ...ceived T Data has recently been transmitted Where relevant these status indications are displayed for a short length of time to make them visible to the human eye The display in figure 5 2 shows that the SpaceWire link is connected at 34 Mb s that the unit will respond to IP address 192 168 3 42 that the Ethernet port is connected from port 35798 on IP address 192 168 3 60 at 100 Mb s 4Links Limit...

Page 23: ...eft side or downwards bottom line left side After pushing the switch down we see aram1 Figure 6 1 The ESL serial number and configuration display The chart below shows how to navigate the settings menus The current state is shown as a box with three sections The top section shows a label that indicates the effect if any of pushing the switch up The middle section describes what is displayed The bo...

Page 24: ...splay and pushing it again in the same direction will return to the main status display Selecting the Settings display with two operations of the switch in opposite directions and doing nothing will result in all the settings being displayed in turn and then the display will return to its normal status display mode Selecting the Settings display and then pushing the switch down Change allows these...

Page 25: ...t Setting Next Digit Status Display Configuration Display Configuration Display IP Address Display IP Address Increment Change IP address Status Display Figure 6 4 ESL front panel states 4Links Limited www 4Links co uk support 4Links co uk page 25 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 26: ...and thus may only be set between 0 and 255 attempts to set the values 256 to 299 will cycle digits within that byte and selecting next digit will not move to the next byte until the value is within range Figure 6 5 The IP address display 4Links Limited www 4Links co uk support 4Links co uk page 26 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 27: ...enerating an EEP character This option allows selected events to be seen by the user for diagnostic purposes Events reported by this option are when ECSS errors ESC ESC ESC EOP ESC EEP Timeout Parity error are received Time codes are received and the TC option is installed Option ER facilities may be accessed In the Error Reporting and Waveform Capture pull down menu in the SpaceWireUI program Usi...

Page 28: ...nd if it is enabled on every byte of a packet this results in eleven times as much traffic as for the packet alone This can soon saturate the Ethernet connection and should be used with caution Time tagging the first data byte and the end of packet marker gives useful information with a much lower overhead and is recommended for normal use Option TT facilities may be accessed In the Time tags pull...

Page 29: ... of waveform display trigger SpaceWire event trigger Waveform active SpW port Recorder Figure 10 1 Option EW triggering waveform capture and external signals Each SpaceWire port generates an event when one or more of the following have been enabled and subsequently occur SpWIO ew flag ESL Option Description v w ER Flow control errors are detected a b c x p ER The ECSS errors ESC ESC ESC EOP ESC EE...

Page 30: ...ite 1 ew e An event is generated when an EEP is seen on SpaceWire port 1 1 ew t A port 1 trigger is output when time codes arrive Running java jar SpWIO jar without any parameters will display a table of values suitable for inclusion in the ew parameter Many of these will only be relevant to other 4Links EtherSpaceLink family products such as the Diagnostic SpaceWire Interface The es parameter is ...

Page 31: ...s the ECSS E ST 50 12C standard specifies that a time code should contain 6 bits and that the other two bits in the transmitted byte should be 0 Continuous or one shot time code transmissions The starting value for a sequence of time codes Time code intervals of 10 µs to 999 s The ESL can receive time codes at 10 µs intervals Option TC facilities may be accessed In the Time codes pull down menu in...

Page 32: ...llows up to 15 characters to be saved for transmission as one contiguous unit Option TC facilities may be accessed In the Store and forward buffer pull down menu in the SpaceWireUI program Using the and characters on the SpWIO command line By using the C language API to write a SPECIAL packet containing the buffered transmission to the Store and Forward module 4Links Limited www 4Links co uk suppo...

Page 33: ...ly entering SpaceWire data packets The waveform jar program that displays stored event error waveform files A C language Application Programming Interface API that allows users to write their own programs which access the ESL unit across the Internet The SpW exe program that provides a high throughput demonstration of the ESL as well as a complex example of C language API programming 4Links Limite...

Page 34: ...rSpaceLink h Declarations of the API procedures for inclusion in the source code of user programs that access the ESL EtherSpaceLink c The actual API code for compilation with the application program source code SpW c An example program showing uses of the API It runs a continuous performance or data integrity test sending and receiving packets via the EtherSpaceLink family of units including ESL ...

Page 35: ...show each waveform as it is encountered This window shows the time tag of the event that triggered the waveform capture an indication of the type of event and the time scale of the recording The time scale may be adjusted using a pull down menu The waveform may by saved to a file with the default extension swf SpaceWire WaveForm not ShockWave Flash using the button provided Saved waveforms may be ...

Page 36: ... user program will normally interface with a 4Links EtherSpaceLink family unit by using the Application Programming Interface API that is described in this manual 14 1 1 Principles of Operation The EtherSpaceLink family SpaceWire interface products primarily support the transmission of concurrent streams of traffic from their Ethernet connection to one or more SpaceWire ports one for ESL up to eig...

Page 37: ...ge or sometimes portal is a device that transfers data from one medium to another In our case the 4Links EtherSpaceLink interfaces are Ethernet to SpaceWire bridges 14 1 3 Protocol Hierarchy The C language API interfaces to a Native Interface which communicates over Ethernet via a TCP IP socket connection The EtherSpaceLink unit then converts the received data stream to SpaceWire This may be seen ...

Page 38: ...therSpaceLink Protocol User application programs communicate with the 4Links EtherSpaceLink Family units using Ethernet and a single TCP IP stream The EtherSpaceLink Protocol that runs on this TCP IP stream carries Data packets that will be transmitted on SpaceWire Data packets received from SpaceWire Lots of extra control information all multiplexed together and flow controlled but with some timi...

Page 39: ...ly numbered from zero upwards but the modules located in those slots need not have the same numbers nor need they be contiguously numbered nor in any particular sequence API functions provide mappings from module numbers to locations slot numbers or in most cases provide direct access to module functionality Later EtherSpaceLink family products such as the Diagnostic SpaceWire Interface DSI and th...

Page 40: ...command lines are included here for Microsoft Windows and for Linux Under Windows using the Visual C compiler run vcvars32 once to set up the compiler for command line access cl MT D _X86_ c api example c EtherSpaceLink c wsock32 lib For Linux using the gcc compiler run gcc o c api example c api example c EtherSpaceLink c lm lpthread Our customers also successfully use the EtherSpaceLink c C API c...

Page 41: ...r rx_buffer 4096 receive buffer int bytes_received the size of the packet returned int terminator the native interface terminator int loop_index status misc storage unsigned char HWA 6 Ethernet hardware address if argc 2 fprintf stderr Usage s IP address n argv 0 exit 1 ESL_unit EtherSpaceLink_open argv 1 if ESL_unit 0 fprintf stderr Unable to open connection to s n argv 1 exit 1 Get static ESL pr...

Page 42: ...P EOP EEP EtherSpaceLink_close ESL_unit return 0 This program accepts the IP address of an EtherSpaceLink family product or hostname if it will be recognised on your computer from the command line and opens a TCP IP connection to it interrogates the device for its product details sets up link 1 for transmission at the default speed of 10 Mbps and waits for it to connect sends a 4 byte EOP terminat...

Page 43: ...paceLink_EOP terminator EtherSpaceLink_write_packet may be used to write special command packets using the EtherSpaceLink_SPECIAL terminator Writing incorrect special packets to an EtherSpaceLink unit can have unpredictable effects 14 5 2 Receiving SpaceWire Data and Special Packets Receiving SpaceWire data and control information from an EtherSpaceLink unit is complicated by the need to de interl...

Page 44: ...hat request information from an EtherSpaceLink unit and then wait until they receive a response potentially throwing away SpaceWire data that is received in the meantime This is a necessary behaviour because it is impossible to predict how much SpaceWire data might be interleaved with the response and thus how much buffer space to allocate These routines should therefore not be called if there is ...

Page 45: ...ions and concurrent writes to variables are not possible Transferring simple status information from the receiving thread back to the transmitting thread is usually straightforward SpW c and the example in section 14 5 6 An Advanced API Example contains example code to illustrate the use of multiple threads 14 5 5 Maximising the Throughput of API Programs ESL units support just one active SpaceWir...

Page 46: ...rx Compile on Linux gcc O2 o c api example2 esl c api example2 esl c EtherSpaceLink c lm lpthread Compile on Windows cl MT D _X86_ c api example2 esl c EtherSpaceLink c wsock32 lib include stdio h include sys timeb h include signal h include EtherSpaceLink h EtherSpaceLink ESL_unit int running 1 FILE rx_fd Output file char filename 256 Shut down void shut_down int sig fprintf stderr nCtrl C seen n...

Page 47: ...reading from the input file in blocks of 1024 while feof tx_fd int length fread txdata 1 sizeof txdata tx_fd status EtherSpaceLink_write_packet ESL_unit txdata length EtherSpaceLink_EOP EtherSpaceLink_flush ESL_unit sleep 1 Send SpaceWire time code 99 to shut down the receiver EtherSpaceLink_set_timecode_transmit ESL_unit 0 99 1 EtherSpaceLink_flush ESL_unit fclose tx_fd printf Transmitter finishe...

Page 48: ...rxbuf if tcode 99 receiving 0 break default printf d Special bytes_received for ii 0 ii bytes_received ii printf 02x int rxbuf ii 0xff printf n else partial data packets if terminator EtherSpaceLink_PART_EOP_EEP terminator EtherSpaceLink_PART_EXTN terminator EtherSpaceLink_PART_SPECIAL fwrite rxbuf 1 bytes_received rx_fd total_received bytes_received else normal SpaceWire data if terminator EtherS...

Page 49: ...therSpaceLink_set_speed ESL_unit 100 Set link speed to 100 Mb sec printf s EtherSpaceLink_get_manufacturer_string ESL_unit printf s EtherSpaceLink_get_product_string ESL_unit printf i ports n ports printf Serial number s EtherSpaceLink_HWA_to_serial_number_string HWA printf at 2 2X 2 2X 2 2X 2 2X 2 2X 2 2X HWA 0 HWA 1 HWA 2 HWA 3 HWA 4 HWA 5 printf n n status EtherSpaceLink_set_active_link ESL_uni...

Page 50: ...api example2 esl 192 168 3 42 fileo filei Connecting to 192 168 3 42 OK 4Links Limited ESL RG401 v1 5 8 ports Serial number A260 at 00 50 C2 21 21 04 Opened filei Opened fileo Transmitter finished Receiver finished 100000000 data bytes received Closing rx file OK For a considerably more extensive example see SpW c which is included in the software bundle with your 4Links product 4Links Limited www...

Page 51: ...s Notice that some functions and some parameter values are only available for particular EtherSpaceLink family products or for products that have been purchased with particular optional features 4Links Limited www 4Links co uk support 4Links co uk page 51 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 52: ...rSpaceLink to an internal buffer for use by procedures accessing status and module information When opened the SpaceWire link will be in the disabled state and its default speed will be 10Mb s Module and link parameters can be set immediately but the link must be started using EtherSpaceLink_set_mode before data can be transferred over the SpaceWire link Input parameters ip_address a pointer to a ...

Page 53: ...error and exit else Use the connection EtherSpaceLink_close ESL_unit Example If suitable host name associations are available we could use ESL_unit EtherSpaceLink_open a202 or ESL_unit EtherSpaceLink_open dsi A202 4links co uk 4Links Limited www 4Links co uk support 4Links co uk page 53 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 54: ...he unit then becomes free to accept another connection Input parameters ESL_unit the handle returned by a successful open command Returns None See Also EtherSpaceLink_open Example include EtherSpaceLink h EtherSpaceLink ESL_unit ESL_unit EtherSpaceLink_open 192 168 3 101 EtherSpaceLink_close ESL_unit 4Links Limited www 4Links co uk support 4Links co uk page 54 of 110 T 44 1908 642001 F 44 1908 363...

Page 55: ...ries in the log file will begin with the text Rx p for data received on port p Tx p for data transmitted on port p Alternatively if a SpaceWire link id has been set for a particular EtherSpaceLink unit Rx id p for data received on port p Tx id p for data transmitted on port p Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command file_name 0 or pointer to name of...

Page 56: ...ile Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command id a pointer to a text string Returns None Example include EtherSpaceLink h EtherSpaceLink ESL_unit ESL_unit EtherSpaceLink_open 192 168 3 101 EtherSpaceLink_set_id ESL_unit Camera EtherSpaceLink_set_log_file ESL_unit Experiment_1205 4Links Limited www 4Links co uk support 4Links co uk page 56 of 110 T 44...

Page 57: ... parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command mode a value derived by selecting one of the first three settings and then possibly ORing the remaining parameters below EtherSpaceLink_LINK_mode_disabled The link is idle and silent EtherSpaceLink_LINK_mode_normal Start the link by actively trying to establish contact EtherSpaceLink_LINK_mode_legacy Don t start u...

Page 58: ...sh 20 Mb s operation on port 4 use the sequence EtherSpaceLink_set_active_link ESL_unit 4 EtherSpaceLink_set_speed ESL_unit 20 EtherSpaceLink_set_mode ESL_unit EtherSpaceLink_LINK_mode_normal 4Links Limited www 4Links co uk support 4Links co uk page 58 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 59: ...ete special packet EEP would not normally be used to terminate a packet but is available here to assist with testing where an erroneous packet may usefully be generated Data is queued in buffers in the API in order to make best use of the TCP IP stream and may not be sent immediately EtherSpaceLink_flush should be used to ensure the immediate transmission of any buffered data Input parameters ESL_...

Page 60: ...SpaceLink_set_mode ESL_unit EtherSpaceLink_LINK_mode_normal EtherSpaceLink_write_packet ESL_unit ABCD 4 EtherSpaceLink_EOP initialise buffer before sending it EtherSpaceLink_write_packet ESL_unit buffer 15 EtherSpaceLink_EOP EtherSpaceLink_flush ESL_unit 4Links Limited www 4Links co uk support 4Links co uk page 60 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchle...

Page 61: ...ed by a successful EtherSpaceLink_open command Returns 0 Data is waiting to be transmitted 1 There is no data waiting to be transmitted 1 An error occurred Note Be aware that EtherSpaceLink_write_buffer_empty consumes SpaceWire data from the TCP IP connection to the EtherSpaceLink unit while it is waiting for a successful response If the unit under test generates asynchronous traffic this might be...

Page 62: ...ESL_unit the handle returned by a successful EtherSpaceLink_open command Returns zero The request was data was successful non zero An error occurred data may not have been sent to the EtherSpaceLink unit Example EtherSpaceLink ESL_unit char buffer 1024 ESL_unit EtherSpaceLink_open Rosetta EtherSpaceLink_set_mode ESL_unit EtherSpaceLink_LINK_mode_normal EtherSpaceLink_write_packet ESL_unit ABCD 4 E...

Page 63: ... period of waiting after the last received data not a delay from issuing the EtherSpaceLink_read_packet command Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command ms the timeout period in milli seconds Returns None Example This function call causes future EtherSpaceLink_read_packet calls to return partial received packets after 500 ms even if an EtherSpaceLin...

Page 64: ... part or all of a packet an end of packet EOP was received EtherSpaceLink_EEP This is the last part or all of a packet containing an error an error end of packet EEP was received EtherSpaceLink_PART_EOP_EEP The packet was larger than the available buffer Another read will retrieve more data from the same packet Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open comma...

Page 65: ...nk_LINK_mode_normal n EtherSpaceLink_read_packet ESL_unit buffer 1024 EOP switch EOP case EtherSpaceLink_PART_EOP_EEP more of the packet is available break case EtherSpaceLink_EOP complete good packet break case EtherSpaceLink_EEP packet with error break 4Links Limited www 4Links co uk support 4Links co uk page 65 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchle...

Page 66: ...unit void callback_buffer int callback_buffer_length void callback int length int complete int data_buffer_position Description This function is DEPRECATED Please use EtherSpaceLink_read_packet_special_callback instead 4Links Limited www 4Links co uk support 4Links co uk page 66 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 67: ...he packet will be incomplete only if it is larger than the callback buffer in which case returning from the callback procedure will result in that procedure being called again with the next segment or the rest of the special packet data_buffer_position indicates the index of the next data byte that will be written to the normal data buffer and thus serves to indicate the relative position of this ...

Page 68: ...anual Returns None Note See EtherSpaceLink_read_packet_full and SpW c for examples of this function 4Links Limited www 4Links co uk support 4Links co uk page 68 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 69: ...t containing an error an error end of packet EEP was received EtherSpaceLink_PART_EOP_EEP The packet was larger than the available buffer another read will retrieve more data from the same packet EtherSpaceLink_SPECIAL This is the last part or all of a special packet EtherSpaceLink_PART_SPECIAL A special packet was received but the packet was larger than the available buffer another read will retr...

Page 70: ... Returns 0 The number of data bytes actually in the receive buffer 1 An error occurred N 2 If the received data was special data and the action requested was to report such data then the returned value is negative the absolute value minus 2 being the number of special data bytes available e g a return value of 3 indicates a special packet containing 1 byte is available Example Using the same buffe...

Page 71: ...k_LINK_mode_normal n EtherSpaceLink_read_packet_full ESL_unit buffer 1024 EOP EtherSpaceLink_REPORT_SPECIAL_DATA if n 0 1 if an error or else s EtherSpaceLink_read_packet_full ESL_unit special 1024 EOP EtherSpaceLink_RETURN_SPECIAL_DATA now we have the actual data in special else it was normal data in buffer 4Links Limited www 4Links co uk support 4Links co uk page 71 of 110 T 44 1908 642001 F 44 ...

Page 72: ...rSpaceLink_ER error report break default something else char data_buffer 1024 int n int EOP ESL_unit EtherSpaceLink_open 192 168 3 40 EtherSpaceLink_set_mode ESL_unit EtherSpaceLink_LINK_mode_normal EtherSpaceLink_read_packet_callback ESL_unit callback_buffer 1024 callback n EtherSpaceLink_read_packet_full ESL_unit data_buffer 1024 EOP EtherSpaceLink_CALLBACK_SPECIAL_DATA 4Links Limited www 4Links...

Page 73: ...unit the handle returned by a successful EtherSpaceLink_open command buffer a buffer to contain received data length the size of the receive buffer special_action what to do if a special packet is received If one of these actions is not specified those packets will be discarded EtherSpaceLink_ DISCARD_SPECIAL_DATA Ignore any special data packets EtherSpaceLink_ REPORT_SPECIAL_DATA Retain the speci...

Page 74: ...read_packet_full Example An asynchronous packet read with later a blocking wait EtherSpaceLink_read_packet_full_nowait ESL_unit buffer buffer_length terminator 0 immediate processing and then a blocking wait read_length EtherSpaceLink_read_packet_wait_for_completion ESL_unit 4Links Limited www 4Links co uk support 4Links co uk page 74 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB ...

Page 75: ... time as the packet is being received The status of the transfer can be tested for example with while read_length EtherSpaceLink_read_packet_status ESL_unit 0 A negative value from read_packet_status indicates that the transfer is not yet complete printf waiting n usleep 500000 A read length 0 from read_packet_status indicates that the transfer has completed 4Links Limited www 4Links co uk support...

Page 76: ..._packet_full_nowait request Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command Returns 0 the read has not yet completed 0 the read has completed and this is the number of bytes in the packet Note See EtherSpaceLink_read_packet_full_nowait for an example of this function 4Links Limited www 4Links co uk support 4Links co uk page 76 of 110 T 44 1908 642001 F 44 ...

Page 77: ...k_read_packet_full_nowait request to complete Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command Returns 0 the read completed with an error 0 the read has completed and this is the number of bytes in the packet Note See EtherSpaceLink_read_packet_full_nowait for an example of this function 4Links Limited www 4Links co uk support 4Links co uk page 77 of 110 T ...

Page 78: ...ion for details Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command speed the required link transmit speed in Mb s Returns zero the request was successful non zero an error occurred data may not have been sent to the EtherSpaceLink unit See Also EtherSpaceLink_open Example EtherSpaceLink ESL_unit ESL_unit EtherSpaceLink_open 192 168 3 40 EtherSpaceLink_set_spe...

Page 79: ...s s if the value is greater than 1 000 000 and in units of Mb s otherwise This is unlike EtherSpaceLink_set_speed which uses Mb s only Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command speed the required link transmit speed in Mb s Returns zero the request was successful non zero an error occurred data may not have been sent to the EtherSpaceLink unit See Al...

Page 80: ...the TCP IP connection until it receives a successful response If the unit under test generates asynchronous traffic while this polling takes place that SpaceWire traffic might be discarded EtherSpaceLink_link_connected returns a result code of 1 if any SpaceWire data is lost See section 14 5 3 Asynchronous Issues during Status Polling Example EtherSpaceLink ESL_unit Open a TCP IP link to the ESL u...

Page 81: ... Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command Returns 1 The number of ports on this unit 1 An error occurred Note Be aware that EtherSpaceLink_get_number_of_links should only be called at the start of an API program before the SpaceWire link s are enabled See section 14 5 3 Asynchronous Issues during Status Polling Example int Nlinks EtherSpaceLink ESL_...

Page 82: ... should be disabled using EtherSpaceLink_set_mode ESL_unit EtherSpaceLink_LINK_mode_disabled to prevent unnecessary transients on the line as it is powered down Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command port_number the number of the port to be made active The requested port should be in the range 1 to the number of ports on the unit Returns 0 Request...

Page 83: ...erSpaceLink_open command Returns char This is a pointer to the memory area containing a zero terminated string of 8 bit characters A null pointer 0 is returned if an error occurred while obtaining the data Note Be aware that EtherSpaceLink_get_manufacturer_string should only be called at the start of an API program before the SpaceWire link s are enabled See section 14 5 3 Asynchronous Issues duri...

Page 84: ...eLink_open command Returns char This is a pointer to the memory area containing a zero terminated string of 8 bit characters A null pointer 0 is returned if an error occurred while obtaining the data Note Be aware that EtherSpaceLink_get_product_string should only be called at the start of an API program before the SpaceWire link s are enabled See section 14 5 3 Asynchronous Issues during Status P...

Page 85: ...parameters HWA a pointer to an array of 6 bytes to receive the address Returns 0 if successful 1 if an error occurred while getting data Note Be aware that EtherSpaceLink_get_HWA should only be called at the start of an API program before the SpaceWire link s are enabled See section 14 5 3 Asynchronous Issues during Status Polling Example EtherSpaceLink ESL_unit unsigned char HWA 6 ESL_unit EtherS...

Page 86: ...AC address Input parameters HWA a pointer to an array of 6 bytes containing the address Returns char This is a pointer to the memory area containing a zero terminated string of 8 bit characters Example EtherSpaceLink ESL_unit unsigned char HWA 6 ESL_unit EtherSpaceLink_open 192 168 3 40 EtherSpaceLink_get_HWA ESL_unit HWA printf Serial number s EtherSpaceLink_HWA_to_serial_number_string HWA 4Links...

Page 87: ...The slot number of the requested module Current modules include EtherSpaceLink_MANUFACTURER Product manufacturer EtherSpaceLink_PRODUCT Product name EtherSpaceLink_HWA Ethernet MAC address EtherSpaceLink_LINK_SPEED Link speed control and status EtherSpaceLink_LINK Link operating mode control and status EtherSpaceLink_SF Store and forward option EtherSpaceLink_TT Time tag option EtherSpaceLink_ER E...

Page 88: ...it unsigned char HWA 6 ESL_unit EtherSpaceLink_open 192 168 3 40 EtherSpaceLink_get_HWA ESL_unit HWA is there a time tag module if EtherSpaceLink_get_module_slot ESL_unit EtherSpaceLink_TT printf TT 4Links Limited www 4Links co uk support 4Links co uk page 88 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 89: ...umber Output parameters control_buffer is filled with the enquiry results from the module Returns 0 the number of bytes of data in the buffer 1 if an error occurred Note This function is not available for the DSI or SRR products Be aware that EtherSpaceLink_get_control_packet consumes SpaceWire data from the TCP IP connection to the EtherSpaceLink unit while it is waiting for a successful response...

Page 90: ...the control packet Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command buffer an area containing a control packet such as that returned by EtherSpaceLink_get_control_packet Returns 0 The actual type not slot number of the module that generated this packet 1 An error occurred Note This function is not available for the DSI or SRR products See Also EtherSpaceLin...

Page 91: ... command enable Set this control value to 1 to enable the reporting of received time codes and to 0 to disable the reporting of received time codes Returns 0 Success 1 An error occurred Note DSI series units which cannot use this EtherSpaceLink_set_timecode_receive function should use EtherSpaceLink_ER_enable_reporting ESL_unit EtherSpaceLink_ER_report_time_code instead Example This example causes...

Page 92: ... codes each time the rising edge of an external trigger signal on input SMA3 4 is detected The threshold of this input is 0 5 V The signal may be fed into either SMA port J3 or SMA port J4 and the line must be terminated by 50 Ω typically with a 50 Ω SMA terminator attached to the other SMA port Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command bits how many...

Page 93: ...s resumed after disconnecting the TCP IP connection and re connecting it It is therefore advisable to disable the time code generator in all API programs that are run on an ESL unit unless they explicitly enable time code generation Use EtherSpaceLink_set_timecode_transmit ESL_unit 0 0 0 to do this Example This example sets up an ESL unit to transmit 6 bit ECSS compliant time codes once per second...

Page 94: ...cted by this function for TT and ER generated packets only Input parameters ESL_unit the handle returned by a successful EtherSpaceLink_open command buffer an area containing a control packet such as that returned by EtherSpaceLink_get_control_packet Returns double the value of the time tag in the packet Example void callback int length int complete int data_buffer_position switch EtherSpaceLink_e...

Page 95: ...onnection EtherSpaceLink_ER_report_first_fct ESL Report when a starting link receives a flow control character a key event in establishing a connection EtherSpaceLink_ER_report_starting_error ESL Report any errors when the link is starting i e the SpaceWire state machine is in any state except Run EtherSpaceLink_ER_report_running_error Report any errors when the link is running i e when the SpaceW...

Page 96: ...ccurred Example EtherSpaceLink_ER_enable_reporting ESL_unit EtherSpaceLink_ER_report_running_error EtherSpaceLink_ER_report_starting_error 4Links Limited www 4Links co uk support 4Links co uk page 96 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 97: ...t_fct ESL Report when a starting link receives a flow control character a key event in establishing a connection EtherSpaceLink_EW_capture_starting_error ESL Report any errors when the link is starting i e when the SpaceWire state machine is in any state except Run EtherSpaceLink_EW_capture_running_error Report any errors when the link is running i e when the SpaceWire state machine is in the Run ...

Page 98: ...ror occurred See Also EtherSpaceLink_EW_source Example EtherSpaceLink_EW_enable_reporting ESL_unit EtherSpaceLink_EW_capture_running_error 4Links Limited www 4Links co uk support 4Links co uk page 98 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 99: ...eated with logical OR not numerical addition EtherSpaceLink_TT_report_nothing Disable all time tag reporting EtherSpaceLink_TT_report_first_byte Generate a time tag on the first byte of a packet EtherSpaceLink_TT_report_intermediate_bytes Generate a time tag on all bytes of a packet between the first byte and the end of a packet Warning this can produce a lot of information EtherSpaceLink_TT_repor...

Page 100: ...SC_EOP DSI Generate a time tag when the escape end of packet sequence is received EtherSpaceLink_TT_report_ESC_EEP DSI Generate a time tag when the escape error end of packet sequence is received EtherSpaceLink_TT_report_ESC_ESC DSI Generate a time tag when the escape escape sequence is received EtherSpaceLink_TT_report_timeout DSI Generate a time tag when a timeout is detected Input parameters ES...

Page 101: ...opback connector on that port and run a simple loop back test using SpWIO to check the ESL unit s hardware Then plug in the equipment under test and probe this Have you successfully made that port active by using 1 2 etc in SpWIO or EtherSpaceLink_set_active_link SpW_link i from the programming API Does the ESL unit s front panel display show that the link is connected Are the R and or the T indic...

Page 102: ...ceWire link s are disconnecting unexpectedly Is your device under test properly grounded to your ESL unit SpaceWire requires a ground reference to be connected through the outer shield of each SpaceWire cable If this is not done the common mode potential might be too high leading to seemingly random errors or sensitivity to external electromagnetic interference 4Links Limited www 4Links co uk supp...

Page 103: ...link responds correctly through Connecting to the Run state Disconnected The link is actively trying to make a connection by periodically sending sequences of Nulls If there is no response from the other end of the link the state machine will cycle through ErrorReset ErrorWait Ready and Started states A suitable response from the other end of the link will allow Started to lead to Connecting and R...

Page 104: ... 2 Security Notice The configuration files stored on the memory card define the function of the unit These are encrypted and can be used only with the specific unit they were created for The data on the card cannot be used to configure any other unit 18 Product Limitations and Features 18 1 Ethernet The TCP IP packet re transmission timeout is set at a fixed period of 1 second it should be statist...

Page 105: ...lowing specifications as listed in the Official Journal of the European Union and by the International Electrotechnical Commission IEC IEC 61010 1 2010 3rd Edition and EN 61010 1 2010 3rd Edition with US Canada National Deviations 19 3 Equipment Recycling The symbol shown in figure 19 1 indicates that this product complies with the European Union s requirements according to EU Directive 2002 96 EC...

Page 106: ...ectors not to scale Figure 20 1 RG408 plan view with rear SMA connectors Plan view with front SpaceWire connectors and no SMA connectors not to scale Figure 20 2 RG408 plan view without rear SMA connectors 4Links Limited www 4Links co uk support 4Links co uk page 106 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 107: ... 3 RG408 R plan view with rear SMA connectors Plan view with rear SpaceWire connectors and no SMA connectors not to scale Figure 20 4 RG408 R plan view without SMA connectors 4Links Limited www 4Links co uk support 4Links co uk page 107 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 108: ...ceWire connectors not to scale Figure 20 5 RG408 front view Front view with rear SpaceWire connectors not to scale Figure 20 6 RG408 R front view 4Links Limited www 4Links co uk support 4Links co uk page 108 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 109: ...scale Figure 20 7 RG408 rear view with SMA connectors With front SpaceWire connectors and no SMA connectors not to scale Figure 20 8 RG408 rear view with no SMA connectors 4Links Limited www 4Links co uk support 4Links co uk page 109 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Page 110: ...20 9 RG408 R rear view with SMA connectors With rear SpaceWire connectors and no SMA connectors not to scale Figure 20 10 RG408 R rear view without SMA connectors 4Links Limited www 4Links co uk support 4Links co uk page 110 of 110 T 44 1908 642001 F 44 1908 363463 Milton Keynes MK3 6EB UK Suite EU2 Bletchley Park ...

Reviews: