【正文】
section of this site for more details. The ISO11898 standard Remends that bus interface chips be designed so that munication can still continue (but with reduced signal to noise ratio) even if: Either of the two wires in the bus is broken Either wire is shorted to power Either wire is shorted to groundNetwork Flexibility and ExpansionThe contentoriented nature of the CAN messaging scheme delivers a high degree of flexibility for system configuration. New nodes that are purely receivers, and which need only existing transmitted data, can be added to the network without the need to make any changes to existing hardware or software. Measurements needed by several controllers can be transmitted via the bus, thereby removing the need for each controller to have its own individual sensor. How Arbitration Works on the CAN BusIn any system, some parameters will change more rapidly than others. For example parameters that change quickly could be the RPM of a car engine, or the current floor level of an elevator (US) lift (UK). Slower changing parameters may be the temperature of the coolant of a car engine. It is likely that the more rapidly changing parameters need to be transmitted more frequently and, therefore, must be given a higher priority. To determine the priority of messages, CAN uses the established method known as Carrier Sense, Multiple Access with Collision Detect (CSMA/CD) but with the enhanced capability of nondestructive bitwise arbitration to provide collision resolution, and to deliver maximum use of the available capacity of the bus. NonDestructive Bitwise ArbitrationThe priority of a CAN message is determined by the numerical value of its identifier. The numerical value of each message identifier (and thus the priority of the message) is assigned during the initial phase of system design. The identifier with the lowest numerical value has the highest priority. Any potential bus conflicts are resolved by bitwise arbitration in accordance with the wiredand mechanism, by which a dominant state (logic 0) overwrites a recessive state (logic 1). The BenefitsNondestructive bitwise arbitration provides bus allocation on the basis of need, and delivers efficiency benefits that can not be gained fr。 otherwise it is ignored. The unique identifier also determines the priority of the message. The lower the numerical value of the identifier, the higher the priority. In situations where two or more nodes attempt to transmit at the same time, a nondestructive arbitration technique guarantees that messages are sent in order of priority and that no messages are lost. Bit encodingCAN uses Non Return to Zero (NRZ) encoding (with bitstuffing) for data munication on a differential two wire bus. The use of NRZ encoding ensures pact messages with a minimum number of transitions and high resilience to external disturbance. The physical busThe two wire bus is usually a twisted pair (shielded or unshielded). Flat pair (telephone type) cable also performs well but generates more noise itself, and may be more susceptible to external sources of noise. RobustnessCAN will operate in extremely harsh environments and the extensive error checking mechanisms ensure that any transmission errors are detected. See the 39。 return 0。 pthread_create(amp。 init(amp。 return 0。 DialogBoxIndirectParam (amp。}int MiniGUIMain(int argc, const char* argv[]){ ifdef _LITE_VERSION SetDesktopRect(0, 0, 1024, 768)。 breadpos = 0。 pthread_cond_init(amp。 pthread_cond_init(amp。}void init(struct prodcons * b){ pthread_mutex_init(amp。 } break。 EndDialog (hDlg, wParam)。th_b, NULL, dcm, 0)。break。 } return 1。 i = IDC_SHUIJIAO。 case MSG_INITDIALOG: { int i。th_a, NULL, can, 0)。buffer)。static int DialogBoxProc2 (HWND hDlg, int message, WPARAM wParam, LPARAM lParam){ pthread_t th_a,th_b。static void my_notif_proc (HWND hwnd, int id, int nc, DWORD add_data){ if (nc == BN_CLICKED) { SetWindowText (GetDlgItem (GetParent (hwnd), IDC_PROMPT), prompts [id IDC_LAMIAN])。static CTRLDATA CtrlYourTaste[] ={ { static, WS_VISIBLE | SS_GROUPBOX, 16, 10, 130, 160, IDC_STATIC, POWER, 0 }, { button, WS_VISIBLE | BS_AUTORADIOBUTTON | BS_CHECKED | WS_TABSTOP | WS_GROUP, 36, 38, 88, 20, IDC_1, 1, 0 }, { button, WS_VISIBLE | BS_AUTORADIOBUTTON, 36, 64, 88, 20, IDC_2, 2, 0 }, { button, WS_VISIBLE | BS_AUTORADIOBUTTON, 36, 90, 88, 20, IDC_3, 3, 0 }, { button, WS_VISIBLE | BS_AUTORADIOBUTTON, 36, 116, 88, 20, IDC_4, 4, 0 }, { button, WS_VISIBLE | BS_AUTORADIOBUTTON, 36, 142, 100, 20, IDC_5, 5, 0 }, { static, WS_VISIBLE | SS_GROUPBOX | WS_GROUP, 160, 10, 70, 160, IDC_STATIC, Equipment, 0 }, { button, WS_VISIBLE | BS_AUTOCHECKBOX, 170, 38, 50, 20, IDC_6, A, 0 }, { button, WS_VISIBLE | BS_AUTOCHECKBOX | BS_CHECKED, 170, 64, 50, 20, IDC_7, B, 0 }, { static, WS_VISIBLE | SS_LEFT | WS_GROUP, 16, 180, 360, 20, IDC_PROMPT, 1 IS READY,PLEASE WAIT?, 0 }, { button, WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_GROUP, 80, 220, 70, 28, IDOK, OK, 0 }, { button,