Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Do it just in two environments Stepl: Create a CANoe Database that contains the following objects. Three network nodes (N1, N2, N3) Three messages (
Do it just in two environments
Stepl: Create a CANoe Database that contains the following objects. Three network nodes (N1, N2, N3) Three messages ( msg1,msg2,msg3 ) Four signals (sigl, sig2, sig 3 , sig4). Six environment variables(envS1, envLedR1_3, envLedR1_4, envLedR2, envLedCNT2, envLedCNT3) Assign sigl and sig4 to msg1,sig2 to msg2, and sig 3 to msg3. Associate msg1,msg2, and msg3 to N1,N2, and N3 respectively. Step2: Use environment variables and panel editor. Your panel should have at least one button (Name: S1). and five Lcds( Name: LcdRI_3, LcdR1_4, LcdR2, LedCNT2, LcdCNT3). Sten3; When you change the state of the switch to "ON" (by pressing on it), the following procedure starts and continues running as long as the state of the switch remains " ON ". N1 generates two random numbers RI and R2. RI should be between 1 and 25(1RI25) and R2 is either 3 or 4 . The node should store the generated numbers R 1 and R2 in sig 1 and sig4 respectively. The node must wait for 2000ms and then send the message to the can bus. Nodes (N2 \& N3) receive the message of N1 and extract its contents. Based on the content of sig4 (The value of the random number R2 ), the two nodes will take the following actions: a. If R2=3,N2 displays random number R1 on the LcdR1 3,R2 on the LedR2, while N3 ignores the message. i. N2 generates a new random number RN2 between 3 and 5 ( 3RN25 ), this number defines the deerement step. ii. N2 starts to decrement the received R1 number by RN2 every RN2-2 second. You need to display the value of the random number after each decrement on the write window. iii. When the decrement reaches 0 or less, N2 waits for 1000ms and then sends a new message with the received RI incremented by 1 . Nl receives the message of N2 and increments a counter CNT2 by 1 (this counter shows the number of messages received from N ), you can display the content of the CNT2 on the write window and LedCNT2. b. If R2=4,N3 displays random number R1 on the LedR 1,4,R2 on the LodR2, while N2 ignores the message. 1. N3 generates a new random number RN3 between 1 and 3 ( 1RN33 ), this number defines the decrement step. ii. N3 starts to decrement the received RI number by RN 3+3 every RN 3 second. You need to display the value of the random number after each decrement on the write window. iii. When the decrement reaches 0 or less, N3 waits for 1200 msec. and then sends a new message with the received R1 incremented by 1 . N1 reccives the message of N3 and increments a counter CNT3 by 1 (this counter shows the number of messages received from N3), you can display the content of the CNT3 on the write window and LedCNT3. c. As long as CNT2 or CNT3 is less than 5NI keeps generating and sending new messages with new random numbers R1 and R2. If, anytime, the switch state is changed to "OFF", the process should stopStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started