1

Topic: create a simple frame

Hello,
First, I introduce myself I am French, I discovered the canny 7, and I would like help to create a simple frame for a vehicle in automatic, here is this frame:
620 8 00 00 1E A3 1B 5B 00 64
It would be interesting to receive the file developed for this frame, it would allow me to understand, to continue the process of other frames.
thank you in advance
cordially
Pascal


Bonjour,
Tout d'abord, je me présente je suis Français, je découvre le canny 7, et je voudrais de l'aide pour créer une simple trame pour un véhicule en automatique, voici cette trame :
620    8      00    00  1E   A3   1B   5B  00  64 
Ce serait intéressant de recevoir le fichier élaboré pour cette trame, cela me permettrait de comprendre, pour poursuivre le processus des autres trames.
Merci d'avance
Cordialement
Pascal

2

Re: create a simple frame

Do you want to send a CAN message? Did I understand you correctly?
The examples of sending a message you can find here: http://wiki.cannylogic.com/index.php?ti … CAN_Driver
Please try to build yourself diagram and then attach it to your forum message with questions if you will stack.

3

Re: create a simple frame

Thank you for your quick response, I actually managed alone, and it works perfectly.
I put the file in link.
cordially
Pascal



Merci de votre réponse rapide, j'ai effectivement réussi seul, et cela fonctionne parfaitement.
Je mets en lien le fichier.
Cordialement
Pascal

Post's attachments

Attachment icon Active BMS.cfd 3.05 kb, 316 downloads since 2018-07-18 

4

Re: create a simple frame

Nice work!
If you plan to send several different CAN messages, then you have chosen the really right template for it.

5

Re: create a simple frame

Hello,
I noticed a calculation error when adding hexadecimal values.
I try to add 4 different values, I checked in my program canny 7 receives good information, but the result of the addition is not accurate.
In the CannyLab simulator, the values are accurate and the calculations work well.
You will find attached the program as well as a screenshot of the frames.

Do you know where the problem may come from?

cordially

Pascal

https://www.dropbox.com/sh/n9968tvzr9gh … 3Gp0a?dl=0


Bonjour,
J’ai constaté une erreur de calcul lors ce que j’additionne des valeurs en hexadécimal.
Je cherche à additionner 4 valeurs différentes, j’ai contrôlé dans mon programme la canny 7 reçoit bien les bonnes informations, mais le résultat de l’addition n’est pas exact.
Dans le simulateur de CannyLab, les valeurs sont exactes et les calculs fonctionnent bien.
Vous trouverez ci-joint le programme ainsi qu’une capture d’écran des trames.

Savez-vous d’où peut provenir le problème ?

Cordialement

Pascal

6

Re: create a simple frame

First of all, you can switch value representation in simulator to HEX via CannyLab main menu Simulator -> Values format
The second one: I don't understand where exactly you find a problem. The IDs 500-504 selected in your log, but your diagram does not contain the sending messages with these IDs and data calculations for it.

Also, you can attach files directly to your messages on this forum.

7

Re: create a simple frame

Hello,

I am the person who makes the program for liledeal.

Thank you for your reply.
I am trying to add 4 hexadecimal values and send the result with ID 500.
In your simulator the result is correct:
0C8E + 0CEF + 0CE1 + 0D07 = 3365

But when I plug the Canny 7 on my system that sends the data (ID 350 and 351) the result is incorrect.
0C8B + 0CE9 + 0CDB + 0D05 this is not equal to 3154
The result should be 3354.

Did you understand my problem?
If so, do you know how to solve it?
cordially


https://www.dropbox.com/sh/n9968tvzr9gh … 3Gp0a?dl=0

Bonjour,
Merci pour votre réponse.
Je cherche à faire une addition de 4 valeurs hexadécimales et d’envoyer le résultat avec l’ID 500.
Dans votre simulateur le résultat est correct :
0C8E + 0CEF + 0CE1 + 0D07 = 3365

Mais quand je branche le Canny 7 sur mon système qui envoie les données (ID 350 et 351) le résultat est incorrect.
0C8B + 0CE9 + 0CDB + 0D05 ce n’est pas égal à 3154
Le résultat devrait être 3354.

Avez-vous compris mon problème ?
Si oui savez-vous le résoudre ?
Cordialement

Post's attachments

Attachment icon Capture d’écran 2018-08-28 à 09.28.02.png 153.17 kb, 232 downloads since 2018-08-28 

8

Re: create a simple frame

Ok, we check it and let you know quickly.
In the meantime, please check whether you took into account the bytes orders in serial interfaces registers: https://youtu.be/Dtc4XX374u4?t=5m58s

9

Re: create a simple frame

We didn't find any error in arithmetics at runtime. Runtime and simulator both works as discribed: http://wiki.cannylogic.com/index.php?ti … guage#Data
It's looks like you have bytes swaping and overflow here.

10

Re: create a simple frame

Bonjour,
J’ai finalement trouvé pourquoi j’avais une erreur de calcul, je devais inverser les octets.
( voir l’image )
Merci encore pour votre aide.

Hello,
I finally found why I had a miscalculation, I had to reverse the bytes.
(see the picture)
 Thank you again for your help.

Post's attachments

Attachment icon Capture d’écran 2018-08-29 à 09.24.56.png 273.6 kb, 271 downloads since 2018-08-29 

11

Re: create a simple frame

Excellent!
You are welcome!

12

Re: create a simple frame

Hello,
I'm trying to communicate the Canny 7 with a Nextion Touchscreen (nextion itead cc) via the Canny 7's RS-232 serial port.
I made a small test program that sends 3 trams on TX, when they are received they must change a number (n0) on the screen.
I do not know what to send in UART1 TX LEN ?

In the simulator of Nextion Editor when I send this hexadecimal code it changes the value on the screen. 6E 30 2E 76 61 6C 3D 31 30 ff ff ff

In this Dropbox link you will find the Canny 7 test file as well as the Nextion file.
I would like to know if the program Canny 7 is correct to send the hexadecimal code to Nextion?

https://www.dropbox.com/sh/sit6lkoyz991 … ncJFa?dl=0


Bonjour,
J’essaye de faire communiquer le Canny 7 avec un écran tactile Nextion via le port série RS-232 du Canny 7.
J’ai fait un petit programme de test qui envoie 3 tram sur TX, lorsqu’ils sont reçu ils doivent changer un nombre (n0) sur l’écran.
Je ne sais pas ce qu’il faut envoyer dans UART1 TX LEN.

Dans le simulateur de Nextion Editor lors ce que j’envoie ce code la hexadécimal cela modifie la valeur sur l’écran. 6E 30 2E 76 61 6C 3D 31 30 ff ff ff

Vous trouverez dans ce lien Dropbox le fichier de test du Canny 7ainsi que le fichier du Nextion.
Je voudrais savoir si le programme Canny 7 est correcte pour envoyer le code hexadécimal au Nextion ?

Post's attachments

Attachment icon Capture d’écran 2018-09-07 à 20.37.41.png 126.63 kb, 182 downloads since 2018-09-07 

13

Re: create a simple frame

You need to set in UART1 TX LEN register total numbers of bytes in transmitted message.
For example:
for message  6E 30 2E 76 61 6C 3D 31 30 ff ff ff
you need to set in TX LEN register: 12 (decimal)

Also, please refer recommended connection schematic for CANNY 7 & Nextion:

UPDATE: DO NOT USE IT! PLEASE SEE: https://forum.cannylogic.com/viewtopic.php?pid=750#p750

Post's attachments

IMAG0727.jpg, 134.55 kb, 800 x 477
IMAG0727.jpg 134.55 kb, 408 downloads since 2018-09-07 

14

Re: create a simple frame

Also, you need do set UART open drain configuration for CANNY 7, or you will get 12V on Nextion input and probably damage it.

15

Re: create a simple frame

Hello,
Sorry, but it still does not work.
What should I put in the UART inputs?
How to know if the exit number 9 and 10 of Canny 7 are RX or TX?
See the picture of my wiring and the program attached.
Do you know why it does not work?
cordially
https://www.dropbox.com/sh/sit6lkoyz991 … ncJFa?dl=0


Bonjour,
Désolé, mais cela ne fonctionne toujours pas.
Que dois-je mettre dans les entrées UART ?
Comment savoir si la sortie numéro 9 et 10 du Canny 7 sont RX ou TX ?
Voir la photo de mon câblage et le programme en pièce jointe.
Savez-vous pourquoi cela ne fonctionne pas ?
Cordialement

Post's attachments

Attachment icon IMG_364923.jpg 1021.85 kb, 178 downloads since 2018-09-10 

16

Re: create a simple frame

The 9 and 10 channels  of Canny 7 can be configured as half-duplex UART RX/TX each. Please see the docs: http://wiki.cannylogic.com/index.php?ti … ART_Driver
You decide which one to assign to TX and which one to RX.
I believe that the main problem is in your Nextion project
Please see in attachment the working example of the CANNY diagram and Nextion project.
I posted the connection diagram for this example above.
You can take it as a basis for your project.

Post's attachments

Attachment icon c7_t_ctrl.zip 79.12 kb, 284 downloads since 2018-09-10 

Attachment icon c7nextion_example.cfd 5.41 kb, 288 downloads since 2018-09-10 

17

Re: create a simple frame

Thank you for the programs, but unfortunately it still does not work.
The Nextion sends the commends well, I capture them with an RS232 reader.
But I did not receive any order from Canny 7 and there was no reaction to the order.

I noticed a small error in your program at (17 UART2 TX LEN) and not (UART2 TX D1: D0).

Do you have any idea where the problem might come from?

Merci pour les programmes, mais malheureusement cela ne fonctionne toujours pas.
Le Nextion envoie bien les commendes, je les capte avec un lecteur RS232.
Mais je n’ai capté aucune commande du Canny 7 et il n’y a eu aucune réaction à l’envoi de commande.

J’ai repéré une petite erreur dans votre programme au niveau du (17 UART2 TX LEN) et non pas (UART2 TX D1:D0).

Avez-vous une idée d’où pourrait provenir le problème ?

Post's attachments

Attachment icon Capture d’écran 2018-09-14 à 21.22.27.png 647.88 kb, 196 downloads since 2018-09-14 

18 (edited by Konstantin, CANNY logic 15-09-2018 01:03:09)

Re: create a simple frame

This is mature and tested diagram, but I'll check it anyway. This diagram sends exactly 17 bytes in every message. And the UART2 TX D1: D0 register is next under UART2 TX LEN on this diagram. I'm afraid that for further diagnostics I need oscillograms of TX(ch10) and RX(ch9) at CANNY 7 for your installation with this diagram loaded.

19

Re: create a simple frame

I found where the communication problem came from.
I tried with an old Canny 7 and it worked with your program without problems.
On the other hand, I have 2 more received from last week that still refuses to work with the same program and the same wiring.
Watch the video: (My oscilloscope does not work properly but allows to see the pulses)
https://www.dropbox.com/s/rf1le2vxff6gd … 2.m4v?dl=0


Do you have any idea where the problem might come from?
The 2 Canny 7 that does not work in UART works very well with the CAN, I reinject the firmware and the program several times without change.

J’ai trouvé d’où venait le problème de communication.
J’ai essayé avec un ancien Canny 7 et cela a fonctionner avec votre programme sans problème.
Par contre, j’en ai 2 autres reçu de la semaine dernière qui refuse toujours de fonctionner avec le même programme et le même câblage.
Voir la vidéo :  (Mon oscilloscope ne fonctionne pas correctement mais permet de voir les impulsions)

Avez-vous une idée d’où pourrait venir le problème ?
Les 2 Canny 7 qui ne fonctionne pas en UART fonctionne très bien avec le CAN, j’ai réinjecter le firmware et le programme plusieurs fois sans changement.

20

Re: create a simple frame

I'm afraid that I do not quite understand what's happening on the video. When I asked for an oscillogram, I hoping for something like this photo: https://i.stack.imgur.com/lo51J.jpg
The signal levels and voltage offset on the controller's channel 8 (RX) related to controller's GND when controller "hear" Nextion and then it not - are mostly important for diagnostic. The common GND and the signal crossing over 3.1-3.2V level is critical for communication.
An alternative and more stable way to connect a 12V(!) IO controller (CANNY 7) to a 3.3V(!) display (Nextion) is to using a level converter like this: https://www.sparkfun.com/products/12009
All controllers undergo quality control. You can check ch9 and ch10 channels by writing a simple diagram, which will be read, for example, pressing buttons on these channels and turning onboard LED.

21

Re: create a simple frame

My oscilloscope does not work, it is down.

It worked on a Canny 7, but not on the other 2, with the same program and wiring.
I think there is a problem on the in and out 9 and 10.
I tried it with another very simple program, it does not work.
See the video, the second Canny 7 works, but the other 2 do not work, they have the same program and the same wiring:
https://www.dropbox.com/s/kc37b04j7gddk … 2.m4v?dl=0


Mon oscilloscope ne fonctionne pas, il est en panne.

Cela a fonctionné sur un Canny 7, mais pas sur les 2 autres, avec le même programme et le même câblage.
Je pense qu’il y a un problème sur les entré et sortir 9 et 10.
Je l’ai essayé avec un autre programme très simple, cela ne fonctionne pas.
Voir la vidéo, le deuxième Canny 7 fonctionne, mais les 2 autres ne fonctionne pas, ils ont le même programme et le même câblage :

22

Re: create a simple frame

As I say before - the 3.3V signal is on the edge of controller's sensitivity. The parameters of individual controller instances on the edge of sensitivity may slightly vary. I see you did not attempt to check the channels as I advised you. So, please check the operation of the controller channels using the attached diagram. Upload the attached diagram to the controller, connect power to the controller and short-circuit the controller ch 9 and ch 10 to each other but do not connect display to it. Observe the LED for 10 seconds or so. If the green LED turns on twice and red twice  and so on - the channels are working. In this case, just use a level converter to connect the 3.3V display to the controller as I advice you before.

Post's attachments

Attachment icon ch9ch10selftest.cfd 2.1 kb, 259 downloads since 2018-09-19 

23

Re: create a simple frame

Hello ,
OK, it worked with the data converter.
Thank you again for your help.
cordially

Post's attachments

Attachment icon IMG_3703.jpg 940.13 kb, 198 downloads since 2018-09-20 

24

Re: create a simple frame

Congratulations!
Thanks that reported that the problem is solved, it's important.

25

Re: create a simple frame

Hello,
Sorry to come back so late.
But I still have communication problems between Canny 7 and Nextion.

I have several problems:
Video 1, Canny 7 Old Components: https://www.dropbox.com/s/couubvuoielt7 … s.mov?dl=0
After feeding 12 V, the Nextion sends a message continuously to Canny 7, as soon as the message is received, the Canny 7 returns another message to the Nextion.
Canny 7 - »Immediate -» Nextion
Nextion - »Temperature 40 ° of Canny 7 -» Canny7
Once the Canny7 is at temperature, the communication works instantly.


Video 2, Canny 7 new components: https://www.dropbox.com/s/ngotod57bztnm … s.mov?dl=0
There is no communication in the direction Nextion to Canny 7.
Canny 7 - »Immediate -» Nextion
Nextion - »X -» Canny7

I point out that this is the same wiring and the same program.
On the cabling, I used a logic converter that allows Canny 7 communication to Nextion (Video 2 only), but not the other way around.