vxworks Samples

所属分类:VxWorks
开发工具:C/C++
文件大小:331KB
下载次数:247
上传日期:2005-10-13 09:36:31
上 传 者sunyanjing
说明:  vxwork实时操作系统是顶级的商用产品,这些相关的源码,可以作为学习掌握vxworks程序设计的最好的例子,对各种编程工作也是不错的借鉴。
(vxwork real-time operating system is the top commercial products, these related to the source code, can be used as study and master VxWorks program design of the best examples of the wide variety of programming work is a good reference.)

文件列表:
Samples\ansi-c\math\test.h (371, 2002-07-17)
Samples\ansi-c\math\testMath1.c (4201, 2002-07-17)
Samples\ansi-c\math\testMath2.c (4089, 2002-07-17)
Samples\ansi-c\math\testMath3.c (2922, 2002-07-17)
Samples\ansi-c\math (0, 2004-10-26)
Samples\ansi-c\setjmp\test.h (371, 2002-07-17)
Samples\ansi-c\setjmp\testSetjmp.c (4967, 2002-07-17)
Samples\ansi-c\setjmp (0, 2004-10-26)
Samples\ansi-c\stdio\test.h (371, 2002-07-17)
Samples\ansi-c\stdio\teststdio.c (1837, 2002-07-17)
Samples\ansi-c\stdio\teststdio1.c (0, 2002-07-17)
Samples\ansi-c\stdio\teststdio2.c (6490, 2002-07-17)
Samples\ansi-c\stdio (0, 2004-10-26)
Samples\ansi-c\test\test.h (371, 2002-07-17)
Samples\ansi-c\test\testLocale.c (3248, 2002-07-17)
Samples\ansi-c\test (0, 2004-10-26)
Samples\ansi-c\time\test.h (612, 2002-07-17)
Samples\ansi-c\time\testCtimePST.c (2722, 2002-07-17)
Samples\ansi-c\time\testCtimeUTC.c (3607, 2002-07-17)
Samples\ansi-c\time\testGmtime.c (4806, 2002-07-17)
Samples\ansi-c\time\testMktime.c (4996, 2002-07-17)
Samples\ansi-c\time\testStrftime.c (5933, 2002-07-17)
Samples\ansi-c\time (0, 2004-10-26)
Samples\ansi-c\tod\setTimeOfDay.c (9256, 2002-07-17)
Samples\ansi-c\tod (0, 2004-10-26)
Samples\ansi-c (0, 2004-10-26)
Samples\Deadline_handler_using_Watchdog\deadlineWdDemo.c (7481, 2002-10-30)
... ...

myProtocol - Example custom protocol for vxWorks (Modbus over Ethernet) Copyright 1992-2002 Wind River Systems, Inc. THIS CODE IS FOR EXAMPLE PURPOSES ONLY, USE AT YOUR OWN RISK, NO WARRANTY IS ASSUMED OR IMPLIED The intension of this code is to provide an example of attaching to the MUX layer with a custom ethernet protocol. Though the NPT code is provided for handling alternate frames, it has not been tested. The END support functions are prefixed with myProtocol .. The NPT support functions are prefixed with myProtoNpt.. The Modbus specific functions are prefixed with modbus.. This protocol example implements the Modbus protocol over Ethernet. This is not the published open standard, which implements Modbus over TCP/IP, (Please see www.modbus.org ). In our example the TCP/IP layers are eliminated for the purpose illustrating the use of a custom protocol on vxWorks. Modbus was chosen because it is a very simple open standard, and the author is familiar with it. For those not familiar with Modbus it is an industrial master/slave protocol. The slaves are the publishers of 1 bit and 16 bit numeric data, originally used for communication between devices in an RS232 or RS485 serial network. To use the example code, place the files in a Tornado bootable project directory and add the file myProtocol.c to the project, configure the project for networking, and compile. You will need two target boards on the same subnet running this code. On one board the following code must be run, myProtocolInit(sysBootParams.bootDev, 0) on the other you must make some requests.. #define MAC_ADRS "00:e0:4b:00:fd:61" void doModbus (void) { modbus("write", 1, "holding", "43@"MAC_ADRS, 1); taskDelay(10); modbus("write", 2, "holding", "44@"MAC_ADRS, 1, 2); taskDelay(10); modbus("write", 3, "holding", "45@"MAC_ADRS, 1, 2, 3); taskDelay(10); modbus("write", 4, "holding", "46@"MAC_ADRS, 1, 2, 3, 4); taskDelay(10); modbus("write", 5, "holding", "47@"MAC_ADRS, 1, 2, 3, 4,5); taskDelay(10); modbus("write", 6, "holding", "48@"MAC_ADRS, 1, 2, 3, 4,5,6); taskDelay(10); modbus("write", 7, "holding", "49@"MAC_ADRS, 1, 2, 3, 4,5,6,7); taskDelay(10); modbus("write", 8, "holding", "50@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8); taskDelay(10); modbus("write", 9, "holding", "51@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9); taskDelay(10); modbus("write", 10, "holding", "52@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9,10); taskDelay(10); modbus("write", 11, "holding", "53@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9,10,11); taskDelay(10); modbus("write", 12, "holding", "54@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9,10,11,12); taskDelay(10); modbus("write", 13, "holding", "55@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9,10,11,12,13); taskDelay(10); modbus("write", 14, "holding", "56@"MAC_ADRS, 1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14); taskDelay(10); modbus("read", 30, "holding", "42@"MAC_ADRS); taskDelay(50); }

近期下载者

相关文件


收藏者