From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Discussions au sujet de NI LabVIEW

annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Problème datasocket et sous VI

Bonjour,

 

j'utilise un sous VI (Lab1) pour lire 8bits dans un automate SIEMENS via un OPC. Ce sous VI est appelé en permanence dans le diagramme principal (Lab2).

 

Les 8 bits sont bien lus et affichés dans LABVIEW, mais, de temps en temps, les bits à 1 sont remis à 0 un instant très court avant de repasser à 1.

 

Tout ce passe comme si il y avait une RAZ intempestive et aléatoire de l'octet dans LABVIEW. Peut être est ce lié à la structure de mon diagramme?

 

Merci pour vos suggestions.

 

Bonne journée.

 

Thierry .P

 

 

Tout télécharger
0 Compliments
Message 1 sur 2
3 474 Visites

Lab1:

  • Your first loop iterates once, creating arrays with one element.
  • Your second and third loop are autoindexing, and thus loop only once too.
  • This means your output array will never have more than one element..
  • All FOR loops can be deleted. The index array can be deleted.
  • The x1 can be deleted. The +[i] can be deleted.

 

Lab2:

  • I don't see where you call the code from Lab1
  • Your two subVIs are called in parallel and in random order. Shouldn't you ensure an order?
  • Why don't you handle errors?
  • Why is there such a long delay in Lab1? Desn't that lock the file?
0 Compliments
Message 2 sur 2
3 469 Visites