le 05-11-2024 04:42 PM
Bonjour,
Pour un projet de mémoire je dois créer un programme qui analyse les data de personnes qui courent sur un tapis roulant a une certaine vitesse (ici 16kh/h). J'ai un fichier .txt avec 20 000 data (20secondes), qui comprennent : La vitesse de la bande roulante, l'appui (left ou right), le type de contact (SingleContact ou Aerial en course dans ce cas la) -> voir photo excel
La partie du screen de mon programme prend la colonne 19=T (vitesse bande), 0=A ( temps) et 31=AF (type de contact) à partir de la ligne 44 car il y a les config et les info du tapis de course.
Mon problème : la chaine affiche des 0 au lieu d'afficher les lettres dans la colonne 31 ("SC" ou "Aerial"). Je ne sais absolument pas comment faire pour transformer dans un tableau le "SC" en 1, le "Aerial" en 0 (et pour la marche le "DC" = DoubleContact en 2).
Les NaN au début sont la le temps de l'initialisation. Le = NaN devra être remplacé par SC et la longueur de la fonction "sous ensemble d'une chaine" = 3 c'est pour détecter les NaN. Y'a t-il un problème de format ?
merci
le 05-12-2024 12:07 AM
It is difficult to debug pictures. Start with attaching your VI and a typical datafile.
@Antonin_m84 wrote:
"SC" en 1, le "Aerial" en 0 (et pour la marche le "DC" = DoubleContact en 2).
Create a string array constant with two elements ["Areal", "SC"] then use "search array" with your input will return either 0 or 1 (or -1 for any other string not mentioned).
le 05-12-2024 04:29 AM
Thank you for your answer.
The problem with this function is that it requires a numeric value, not letters.
No array fonction allows you to enter letters (orange constant numeric)
That's why I turned to the string function (pink) but it doesn't work...
I provide an example txt doc of data and my program to see ! 🙂
Thx
05-12-2024 10:40 AM - modifié 05-12-2024 10:43 AM
@Antonin_m84 wrote:The problem with this function is that it requires a numeric value, not letters.
That statement is completely wrong, of course!
Even the help says "of any type"!
I recommend to start with the learning resources loisted at the top of the forum.